move auth pages into auth dir

This commit is contained in:
Huskydog9988
2025-03-22 15:54:43 -04:00
parent 6918e78cf9
commit 6ed7e76b17
7 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,4 @@
const whitelistedPrefixes = ["/signin", "/register", "/api", "/setup"];
const whitelistedPrefixes = ["/auth/signin", "/register", "/api", "/setup"];
const requireAdmin = ["/admin"];
export default defineNuxtRouteMiddleware(async (to, from) => {
@ -13,7 +13,10 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
await updateUser();
}
if (!user.value) {
return navigateTo({ path: "/signin", query: { redirect: to.fullPath } });
return navigateTo({
path: "/auth/signin",
query: { redirect: to.fullPath },
});
}
if (
requireAdmin.findIndex((e) => to.fullPath.startsWith(e)) != -1 &&