mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) fix redirects for multi-team Grist on a single domain
Summary: The logic for calculating redirects wasn't quite right for Grist configured to use a single domain, with teams encoded in the path. This fixes it. Test Plan: tested manually with docker compose and /etc/hosts Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3359
This commit is contained in:
@@ -112,6 +112,9 @@ export interface OrgUrlOptions {
|
||||
|
||||
// Base URL used for accessing plugin material.
|
||||
pluginUrl?: string;
|
||||
|
||||
// If set, org is expected to be encoded in the path, not domain.
|
||||
pathOnly?: boolean;
|
||||
}
|
||||
|
||||
// Result of getOrgUrlInfo().
|
||||
@@ -145,6 +148,9 @@ export function getOrgUrlInfo(newOrg: string, currentHost: string, options: OrgU
|
||||
if (newOrg === options.singleOrg) {
|
||||
return {};
|
||||
}
|
||||
if (options.pathOnly) {
|
||||
return {orgInPath: newOrg};
|
||||
}
|
||||
const hostType = getHostType(currentHost, options);
|
||||
if (hostType !== 'plugin') {
|
||||
const hostname = currentHost.split(":")[0];
|
||||
|
||||
Reference in New Issue
Block a user