mirror of
https://github.com/maciejpedzich/racemash.git
synced 2024-11-28 00:25:47 +01:00
Wrap loadUser call in a try-catch block
This commit is contained in:
parent
ad0558d7cb
commit
6f1ac8a99e
@ -8,7 +8,13 @@ export async function authGuard(
|
||||
) {
|
||||
const { isLoggedIn, loadUser } = useAuth();
|
||||
|
||||
try {
|
||||
await loadUser();
|
||||
} catch (error) {
|
||||
if (import.meta.env.DEV) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
if (!to.meta.authRequired || isLoggedIn.value) {
|
||||
return next();
|
||||
|
Loading…
Reference in New Issue
Block a user