From 73afd331d43e91c4f441ea93a9154c6cd5b17118 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 6 Oct 2021 16:11:10 +0100 Subject: [PATCH] Don't redirect when tenant is missing, if unauthenticated --- packages/builder/src/pages/builder/_layout.svelte | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte index 7888d7a7e0..39c93f0fb0 100644 --- a/packages/builder/src/pages/builder/_layout.svelte +++ b/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()