fix: redirect to login if no session on invite page
This commit is contained in:
@@ -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 || '');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user