From b2471594cf361aa5f5d5bb7d3f0440c235e719b5 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 14 Sep 2021 15:57:34 +0100 Subject: [PATCH] Move account portal redirect to top of auth level --- packages/builder/src/pages/builder/auth/_layout.svelte | 7 ++++++- packages/builder/src/pages/builder/auth/login.svelte | 6 ------ packages/builder/src/pages/builder/portal/_layout.svelte | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/_layout.svelte b/packages/builder/src/pages/builder/auth/_layout.svelte index eb9e229a9d..3254f4ccc2 100644 --- a/packages/builder/src/pages/builder/auth/_layout.svelte +++ b/packages/builder/src/pages/builder/auth/_layout.svelte @@ -1,5 +1,5 @@ diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index c46550b69f..783e5a4903 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -51,12 +51,6 @@ onMount(async () => { await organisation.init() - - // redirect to account portal for login in the cloud - if ($admin.cloud && $admin.accountPortalUrl) { - window.location.href = $admin.accountPortalUrl - } - loaded = true }) diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 3b1ea47e8b..fa25fccde3 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -60,7 +60,7 @@ } // add link to account portal if the user has access - if ($auth.user.account) { + if ($auth?.user?.account) { menu = menu.concat([ { title: "Account",