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

@@ -28,7 +28,7 @@ export class StateStore {
ctx.cookies.set(this.key, state, {
expires: addMinutes(new Date(), 10),
domain: getCookieDomain(ctx.hostname),
domain: getCookieDomain(ctx.hostname, env.isCloudHosted),
});
callback(null, token);
@@ -54,7 +54,7 @@ export class StateStore {
// Destroy the one-time pad token and ensure it matches
ctx.cookies.set(this.key, "", {
expires: subMinutes(new Date(), 1),
domain: getCookieDomain(ctx.hostname),
domain: getCookieDomain(ctx.hostname, env.isCloudHosted),
});
if (!token || token !== providedToken) {
@@ -100,11 +100,11 @@ export async function getTeamFromContext(ctx: Context) {
const domain = parseDomain(host);
let team;
if (!env.isCloudHosted()) {
if (!env.isCloudHosted) {
team = await Team.findOne();
} else if (domain.custom) {
team = await Team.findOne({ where: { domain: domain.host } });
} else if (env.SUBDOMAINS_ENABLED && domain.teamSubdomain) {
} else if (domain.teamSubdomain) {
team = await Team.findOne({
where: { subdomain: domain.teamSubdomain },
});