accessToken per subdomain

This commit is contained in:
Tom Moor
2018-11-09 23:40:33 -08:00
parent c323de4807
commit e24a187699
14 changed files with 201 additions and 332 deletions

View File

@@ -26,12 +26,12 @@ const Auth = observer(({ auth, children }: Props) => {
// Check the current origin against the teams url, if they differ we need to
// redirect to the canonical subdomain for this team
if (window.location.origin !== team.url) {
const redirectTo = `${team.url}${window.location.pathname}`;
console.warn(`Redirecting to ${redirectTo}`);
window.location.href = redirectTo;
return <LoadingIndicator />;
}
// if (window.location.origin !== team.url) {
// const redirectTo = `${team.url}${window.location.pathname}`;
// console.warn(`Redirecting to ${redirectTo}…`);
// window.location.href = redirectTo;
// return <LoadingIndicator />;
// }
// Only initialize stores once. Kept in global scope because otherwise they
// will get overridden on route change