diff --git a/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte b/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte index d8e1da7072..812f744087 100644 --- a/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte +++ b/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte @@ -3,6 +3,7 @@ import GoogleLogo from "assets/google-logo.png" import { auth, organisation } from "stores/portal" + export let samePage let show $: tenantId = $auth.tenantId @@ -12,8 +13,14 @@ {#if show} - window.open(`/api/global/auth/${tenantId}/google`, "_blank")} + on:click={() => { + const url = `/api/global/auth/${tenantId}/google` + if (samePage) { + window.location = url + } else { + window.open(url, "_blank") + } + }} > Log in with Google diff --git a/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte b/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte index 396bde3cb0..1fa392610b 100644 --- a/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte +++ b/packages/builder/src/pages/builder/auth/_components/OIDCButton.svelte @@ -9,6 +9,8 @@ import { oidc, organisation, auth } from "stores/portal" import { onMount } from "svelte" + export let samePage + $: show = $organisation.oidc let preDefinedIcons = { @@ -35,11 +37,14 @@ {#if show} - window.open( - `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}`, - "_blank" - )} + on:click={() => { + const url = `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}` + if (samePage) { + window.location = url + } else { + window.open(url, "_blank") + } + }} > {`Log in with ${$oidc.name || "OIDC"}`} diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index 547c914621..9dae365add 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -78,8 +78,8 @@ {#if loaded && ($organisation.google || $organisation.oidc)} - - + + {/if} {#if !$organisation.isSSOEnforced}