fix
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
import { auth } from "../../lib/auth/store.svelte.js";
|
||||
import { api } from "../../lib/api";
|
||||
import { goto } from "$app/navigation";
|
||||
import { ROUTES } from "$lib/routes";
|
||||
import { hasPermission } from "$lib/auth/permissions.js";
|
||||
|
||||
const { requiredPermission = null, fallbackPath = "/profile", children } = $props();
|
||||
@@ -76,7 +77,7 @@
|
||||
if (!$auth.token) {
|
||||
auth.setLoading(false);
|
||||
console.info("[ProtectedRoute.verifySessionAndAccess][REFLECT] Missing token, redirecting to /login");
|
||||
await goto("/login");
|
||||
await goto(ROUTES.login());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,8 +92,8 @@
|
||||
} catch (error) {
|
||||
console.warn("[ProtectedRoute.verifySessionAndAccess][EXPLORE] Session validation failed", { error });
|
||||
auth.logout();
|
||||
await goto("/login");
|
||||
return;
|
||||
await goto(ROUTES.login());
|
||||
return;
|
||||
} finally {
|
||||
auth.setLoading(false);
|
||||
}
|
||||
@@ -101,7 +102,7 @@
|
||||
if (!currentUser) {
|
||||
auth.logout();
|
||||
console.info("[ProtectedRoute.verifySessionAndAccess][REFLECT] User unresolved, redirecting to /login");
|
||||
await goto("/login");
|
||||
await goto(ROUTES.login());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user