From 7bf178430651ade4762504aa54d261042e3cd609 Mon Sep 17 00:00:00 2001 From: IchthysMaranathaCopy Date: Wed, 13 Mar 2024 09:42:43 +0530 Subject: [PATCH] Add files via upload --- .../src/pages/builder/auth/login.svelte | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index 8c38649b421..a44c3ea2c30 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -28,11 +28,13 @@ $: cloud = $admin.cloud if ($organisation.isSSOEnforced) { - organisation.init().oidc.init() - if (organisation.oidc) { - const url = `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}` - window.location = url - } + organisation + .init() + .then(() => oidc.init()) + .then(() => { + const url = `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}` + window.location = url + }) } async function login() { @@ -61,14 +63,16 @@ if (evt.key === "Enter") login() } - onMount(async () => { - try { - await organisation.init() - } catch (error) { - notifications.error("Error getting org config") - } - loaded = true - }) + if (!$organisation.isSSOEnforced) { + onMount(async () => { + try { + await organisation.init() + } catch (error) { + notifications.error("Error getting org config") + } + loaded = true + }) + }