Browse Source

Don't redirect when tenant is missing, if unauthenticated

pull/2905/head
Rory Powell 5 years ago
parent
commit
73afd331d4
  1. 12
      packages/builder/src/pages/builder/_layout.svelte

12
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()

Loading…
Cancel
Save