This commit is contained in:
DecDuck
2026-06-21 17:01:37 +10:00
parent cbecd1161d
commit 505c324c26
2 changed files with 7 additions and 3 deletions
+1 -2
View File
@@ -2,14 +2,13 @@ const whitelistedPrefixes = ["/auth", "/api", "/setup"];
const requireAdmin = ["/admin"];
export default defineNuxtRouteMiddleware(async (to, _from) => {
if (import.meta.server) return;
const error = useError();
if (error.value !== undefined) return;
if (whitelistedPrefixes.findIndex((e) => to.fullPath.startsWith(e)) != -1)
return;
const user = useUser();
if (user === undefined) {
if (user.value === undefined) {
await updateUser();
}
if (!user.value) {