Minor improvement - opening the google authorization in the same tab as onboarding rather than creating a dead tab.

This commit is contained in:
mike12345567 2023-03-31 14:03:34 +01:00
parent 420190f577
commit 8673ed1dae
2 changed files with 8 additions and 5 deletions

View File

@ -6,6 +6,7 @@
export let preAuthStep export let preAuthStep
export let datasource export let datasource
export let disabled export let disabled
export let samePage
$: tenantId = $auth.tenantId $: tenantId = $auth.tenantId
</script> </script>
@ -25,10 +26,12 @@
ds = resp ds = resp
} }
} }
window.open( const url = `/api/global/auth/${tenantId}/datasource/google?datasourceId=${ds._id}&appId=${appId}`
`/api/global/auth/${tenantId}/datasource/google?datasourceId=${ds._id}&appId=${appId}`, if (samePage) {
"_blank" window.location = url
) } else {
window.open(url, "_blank")
}
}} }}
> >
<img src={GoogleLogo} alt="google icon" /> <img src={GoogleLogo} alt="google icon" />

View File

@ -107,7 +107,7 @@
</FancyForm> </FancyForm>
</div> </div>
{#if isGoogle} {#if isGoogle}
<GoogleButton disabled={!isValid} preAuthStep={handleNext} /> <GoogleButton disabled={!isValid} preAuthStep={handleNext} samePage />
{:else} {:else}
<Button cta disabled={!isValid} on:click={handleNext}>Connect</Button> <Button cta disabled={!isValid} on:click={handleNext}>Connect</Button>
{/if} {/if}