From 9e4609dc7f27f7e219439a9b53cf896423ccec3a Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sat, 8 Nov 2025 05:51:09 +0100 Subject: [PATCH] fix: redirect to login if no session on invite page --- apps/dashboard/src/routes/invite/s/[hash]/+page.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte b/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte index e6bb12a5..31aa4543 100644 --- a/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte +++ b/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte @@ -117,6 +117,14 @@ } onMount(async () => { + // check if user has session, if not redirect to sign up with redirect back to this page + const { + data: { session } + } = await supabase.auth.getSession(); + if (!session) { + return goto(`/login?redirect=${$page.url?.pathname || ''}`); + } + setTheme(data.currentOrg?.theme || ''); });