1
0
Fork 0
mirror of synced 2024-09-30 17:18:14 +13:00

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 586f71e0be
commit 73afd331d4

View file

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