chore: Remove DEPLOYMENT and SUBDOMAINS_ENABLED (#5742)
This commit is contained in:
@@ -18,7 +18,6 @@ import InputColor from "~/components/InputColor";
|
||||
import Scene from "~/components/Scene";
|
||||
import Switch from "~/components/Switch";
|
||||
import Text from "~/components/Text";
|
||||
import env from "~/env";
|
||||
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
||||
import usePolicy from "~/hooks/usePolicy";
|
||||
import useStores from "~/hooks/useStores";
|
||||
@@ -255,7 +254,7 @@ function Details() {
|
||||
<Heading as="h2">{t("Behavior")}</Heading>
|
||||
|
||||
<SettingRow
|
||||
visible={env.SUBDOMAINS_ENABLED && isCloudHosted}
|
||||
visible={isCloudHosted}
|
||||
label={t("Subdomain")}
|
||||
name="subdomain"
|
||||
description={
|
||||
|
||||
@@ -13,6 +13,7 @@ import env from "~/env";
|
||||
import { client } from "~/utils/ApiClient";
|
||||
import Desktop from "~/utils/Desktop";
|
||||
import Logger from "~/utils/Logger";
|
||||
import isCloudHosted from "~/utils/isCloudHosted";
|
||||
|
||||
const AUTH_STORE = "AUTH_STORE";
|
||||
const NO_REDIRECT_PATHS = ["/", "/create", "/home", "/logout"];
|
||||
@@ -212,7 +213,7 @@ export default class AuthStore {
|
||||
return;
|
||||
}
|
||||
} else if (
|
||||
env.SUBDOMAINS_ENABLED &&
|
||||
isCloudHosted &&
|
||||
parseDomain(hostname).teamSubdomain !== (team.subdomain ?? "")
|
||||
) {
|
||||
window.location.href = `${team.url}${pathname}`;
|
||||
@@ -372,7 +373,7 @@ export default class AuthStore {
|
||||
const sessions = JSON.parse(getCookie("sessions") || "{}");
|
||||
delete sessions[team.id];
|
||||
setCookie("sessions", JSON.stringify(sessions), {
|
||||
domain: getCookieDomain(window.location.hostname),
|
||||
domain: getCookieDomain(window.location.hostname, isCloudHosted),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ import env from "~/env";
|
||||
/**
|
||||
* True if the current installation is the cloud hosted version at getoutline.com
|
||||
*/
|
||||
const isCloudHosted = env.DEPLOYMENT === "hosted";
|
||||
const isCloudHosted = [
|
||||
"https://app.getoutline.com",
|
||||
"https://app.outline.dev",
|
||||
"https://app.outline.dev:3000",
|
||||
].includes(env.URL);
|
||||
|
||||
export default isCloudHosted;
|
||||
|
||||
Reference in New Issue
Block a user