Add support for SUBDOMAINS_ENABLED=false

This commit is contained in:
Tom Moor
2018-11-11 22:06:50 -08:00
parent 61138ff4fa
commit b3a8d34af3
6 changed files with 46 additions and 22 deletions

View File

@ -110,7 +110,7 @@ export default function auth(options?: { required?: boolean } = {}) {
// set a transfer cookie for the access token itself and redirect
// to the teams subdomain if subdomains are enabled
if (process.env.SUBDOMAINS_ENABLED && team.subdomain) {
if (process.env.SUBDOMAINS_ENABLED === 'true' && team.subdomain) {
// get any existing sessions (teams signed in) and add this team
const existing = JSON.parse(ctx.cookies.get('sessions') || '{}');
const sessions = JSON.stringify({