diff --git a/apps/dashboard/src/lib/components/AuthUI/index.svelte b/apps/dashboard/src/lib/components/AuthUI/index.svelte index d2b5a7dd..c029ad82 100644 --- a/apps/dashboard/src/lib/components/AuthUI/index.svelte +++ b/apps/dashboard/src/lib/components/AuthUI/index.svelte @@ -16,6 +16,9 @@ export let showLogo = false; export let formRef; export let hideGoogleAuth = false; + export let redirectPathname = ''; + + $: console.log('redirectPathname', redirectPathname); async function signInWithGoogle() { if (isLoading) { @@ -27,7 +30,8 @@ // const redirectTo = `https://app.classroomio.com?forwardTo=${ // window.location.origin + params.get('redirect') // }`; - const redirectTo = `${window.location.origin + params.get('redirect')}`; + const pathname = redirectPathname || params.get('redirect'); + const redirectTo = `${window.location.origin + pathname}`; console.log({ redirectTo }); diff --git a/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte b/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte index 44fcc24a..142763e5 100644 --- a/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte +++ b/apps/dashboard/src/routes/invite/t/[hash]/+page.svelte @@ -135,13 +135,6 @@ } onMount(async () => { - const redirectTo = $page.url.pathname; - - const url = new URL($page.url.pathname); - url.searchParams.set('redirect', redirectTo); - console.log('url', url.toString()); - goto(url.toString()); - setTheme(data.invite.currentOrg?.theme || ''); setCurOrg(data.invite.currentOrg as CurrentOrg); @@ -167,7 +160,15 @@
{#if data.invite.profile}