From 89c9118337544830413ff37b6ee60b473f893711 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 30 Sep 2021 15:56:33 +0100 Subject: [PATCH] Fix tenant subdomain parsing --- packages/builder/src/pages/builder/_layout.svelte | 2 +- packages/builder/src/pages/builder/auth/login.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte index f248210962..338322b785 100644 --- a/packages/builder/src/pages/builder/_layout.svelte +++ b/packages/builder/src/pages/builder/_layout.svelte @@ -20,7 +20,7 @@ if (!tenantId.includes("localhost:")) { // user doesn't have permission to access this tenant - kick them out - if (user?.tenantId !== tenantId) { + if (user && user.tenantId !== tenantId) { await auth.logout() await auth.setOrganisation(null) } else { diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index f9f2b34578..a1dea8fd68 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -22,6 +22,7 @@ $: company = $organisation.company || "Budibase" $: multiTenancyEnabled = $admin.multiTenancy + $: cloud = $admin.cloud async function login() { try { @@ -84,7 +85,7 @@ $goto("./forgot")}> Forgot password? - {#if multiTenancyEnabled} + {#if multiTenancyEnabled && !cloud} {