Don't redirect when tenant is missing, if unauthenticated

This commit is contained in:
Rory Powell 2021-10-06 16:11:10 +01:00
parent 1e209958fd
commit 32012fd24b
1 changed files with 6 additions and 6 deletions

View File

@ -27,13 +27,13 @@
urlTenantId = hostParts[0] urlTenantId = hostParts[0]
} }
if (user && user.tenantId) {
// no tenant in the url - send to account portal to fix this // no tenant in the url - send to account portal to fix this
if (!urlTenantId) { if (!urlTenantId) {
window.location.href = $admin.accountPortalUrl window.location.href = $admin.accountPortalUrl
return return
} }
if (user && user.tenantId) {
if (user.tenantId !== urlTenantId) { if (user.tenantId !== urlTenantId) {
// user should not be here - play it safe and log them out // user should not be here - play it safe and log them out
await auth.logout() await auth.logout()