Attempt to provision subdomain on team create

This commit is contained in:
Tom Moor
2018-11-04 15:02:27 -08:00
parent 6391474d14
commit c323de4807
6 changed files with 53 additions and 5 deletions

View File

@ -27,7 +27,9 @@ 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) {
window.location.href = `${team.url}${window.location.pathname}`;
const redirectTo = `${team.url}${window.location.pathname}`;
console.warn(`Redirecting to ${redirectTo}`);
window.location.href = redirectTo;
return <LoadingIndicator />;
}