Fixes: handling of www subdomain in production

Hanging sessions when subdomain changes
This commit is contained in:
Tom Moor
2018-11-13 23:08:27 -08:00
parent 400d0f264e
commit 26036ad92c
3 changed files with 8 additions and 5 deletions

View File

@@ -3,7 +3,11 @@ import uuid from 'uuid';
import { URL } from 'url';
import { DataTypes, sequelize, Op } from '../sequelize';
import { publicS3Endpoint, uploadToS3FromUrl } from '../utils/s3';
import { RESERVED_SUBDOMAINS } from '../../shared/utils/domains';
import {
stripSubdomain,
RESERVED_SUBDOMAINS,
} from '../../shared/utils/domains';
import Collection from './Collection';
import User from './User';
@@ -50,7 +54,7 @@ const Team = sequelize.define(
}
const url = new URL(process.env.URL);
url.host = `${this.subdomain}.${url.host}`;
url.host = `${this.subdomain}.${stripSubdomain(url.host)}`;
return url.href.replace(/\/$/, '');
},
logoUrl() {