mirror of
https://github.com/outline/outline.git
synced 2026-05-04 16:50:11 -05:00
fix: Don't set cookie domain when not using multiple subdomains (#1145)
* fix: Don't set cookie domain when not using multiple subdomains * wip logging domain * wip logging domain * wip logging domain * wip logging domain * Revert "wip logging domain" This reverts commit325907e749. * Revert "wip logging domain" This reverts commit6ee095a49e. * Revert "wip logging domain" This reverts commit813d8eb960. * Revert "wip logging domain" This reverts commitf1ca819276. * Remove SUBDOMAINS_ENABLED from documented env variables, no-one self hosting should need this – it just adds confusion to those looking to host on a single subdomain fix: Account for server/client process.env parsing Co-authored-by: Nan Yu <nanyu@Nans-MBP-2.lan> Co-authored-by: Nan Yu <nan@getoutline.com>
This commit is contained in:
@@ -42,6 +42,14 @@ export function parseDomain(url: string): ?Domain {
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getCookieDomain(domain: string) {
|
||||
// TODO: All the process.env parsing needs centralizing
|
||||
return process.env.SUBDOMAINS_ENABLED === 'true' ||
|
||||
process.env.SUBDOMAINS_ENABLED === true
|
||||
? stripSubdomain(domain)
|
||||
: domain;
|
||||
}
|
||||
|
||||
export function stripSubdomain(hostname: string) {
|
||||
const parsed = parseDomain(hostname);
|
||||
if (!parsed) return hostname;
|
||||
|
||||
Reference in New Issue
Block a user