unauthenticated redirect (temp)
This commit is contained in:
parent
551951827d
commit
ac4af66cd5
1 changed files with 5 additions and 0 deletions
|
|
@ -32,11 +32,16 @@
|
|||
user = await whoami();
|
||||
} else {
|
||||
user = null;
|
||||
|
||||
if ($page.url.pathname !== '/')
|
||||
goto('/login'); // Redirect to login if not authenticated
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Authentication check failed:', error);
|
||||
isAuthenticated = false;
|
||||
user = null;
|
||||
if ($page.url.pathname !== '/')
|
||||
goto('/login'); // Redirect to login if not authenticated
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue