diff --git a/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte b/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte index 0cf92dde2b..b7d70d88b7 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte @@ -6,6 +6,7 @@ export let preAuthStep export let datasource export let disabled + export let samePage $: tenantId = $auth.tenantId @@ -25,10 +26,12 @@ ds = resp } } - window.open( - `/api/global/auth/${tenantId}/datasource/google?datasourceId=${ds._id}&appId=${appId}`, - "_blank" - ) + const url = `/api/global/auth/${tenantId}/datasource/google?datasourceId=${ds._id}&appId=${appId}` + if (samePage) { + window.location = url + } else { + window.open(url, "_blank") + } }} > google icon 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} diff --git a/packages/builder/src/pages/builder/portal/apps/onboarding/_components/DatasourceConfigPanel.svelte b/packages/builder/src/pages/builder/portal/apps/onboarding/_components/DatasourceConfigPanel.svelte index 333cfdb0c6..2b44648279 100644 --- a/packages/builder/src/pages/builder/portal/apps/onboarding/_components/DatasourceConfigPanel.svelte +++ b/packages/builder/src/pages/builder/portal/apps/onboarding/_components/DatasourceConfigPanel.svelte @@ -107,7 +107,7 @@ {#if isGoogle} - + {:else} {/if}