chore: Remove DEPLOYMENT and SUBDOMAINS_ENABLED (#5742)

This commit is contained in:
Tom Moor
2023-08-28 20:39:58 -04:00
committed by GitHub
parent 7725f29dc7
commit 30a4303a8e
35 changed files with 136 additions and 135 deletions

View File

@@ -26,7 +26,7 @@ router.post("auth.config", async (ctx: APIContext<T.AuthConfigReq>) => {
// If self hosted AND there is only one team then that team becomes the
// brand for the knowledge base and it's guest signin option is used for the
// root login page.
if (!env.isCloudHosted()) {
if (!env.isCloudHosted) {
const team = await Team.scope("withAuthenticationProviders").findOne();
if (team) {
@@ -75,7 +75,7 @@ router.post("auth.config", async (ctx: APIContext<T.AuthConfigReq>) => {
// If subdomain signin page then we return minimal team details to allow
// for a custom screen showing only relevant signin options for that team.
else if (env.SUBDOMAINS_ENABLED && domain.teamSubdomain) {
else if (env.isCloudHosted && domain.teamSubdomain) {
const team = await Team.scope("withAuthenticationProviders").findOne({
where: {
subdomain: domain.teamSubdomain,
@@ -179,7 +179,7 @@ router.post(
ctx.cookies.set("accessToken", "", {
expires: subMinutes(new Date(), 1),
domain: getCookieDomain(ctx.hostname),
domain: getCookieDomain(ctx.hostname, env.isCloudHosted),
});
ctx.body = {