Browse Source
Merge pull request #2905 from Budibase/fix/internal-email-onboarding
Don't redirect when tenant is missing, if unauthenticated
gh-pages
Martin McKeaveney
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
6 deletions
-
packages/builder/src/pages/builder/_layout.svelte
|
|
|
@ -27,13 +27,13 @@ |
|
|
|
urlTenantId = hostParts[0] |
|
|
|
} |
|
|
|
|
|
|
|
// no tenant in the url - send to account portal to fix this |
|
|
|
if (!urlTenantId) { |
|
|
|
window.location.href = $admin.accountPortalUrl |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (user && user.tenantId) { |
|
|
|
// no tenant in the url - send to account portal to fix this |
|
|
|
if (!urlTenantId) { |
|
|
|
window.location.href = $admin.accountPortalUrl |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (user.tenantId !== urlTenantId) { |
|
|
|
// user should not be here - play it safe and log them out |
|
|
|
await auth.logout() |
|
|
|
|