init frontend_management

This commit is contained in:
Missez 2026-01-12 16:49:58 +07:00
parent af58550f7f
commit 62812f2090
23 changed files with 13174 additions and 0 deletions

View file

@ -0,0 +1,7 @@
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore();
authStore.checkAuth();
if (!authStore.isAdmin) {
return navigateTo('/login');
}
});

View file

@ -0,0 +1,7 @@
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore();
authStore.checkAuth();
if (!authStore.isAuthenticated) {
return navigateTo('/login');
}
});

View file

@ -0,0 +1,7 @@
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore();
authStore.checkAuth();
if (!authStore.isInstructor) {
return navigateTo('/login');
}
});