mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-10 04:22:09 +10:00
move auth pages into auth dir
This commit is contained in:
@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user