first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:07:47 +03:00
commit 5285a0dd86
522 changed files with 41738 additions and 0 deletions

11
app/middleware/admin.ts Normal file
View File

@@ -0,0 +1,11 @@
export default defineNuxtRouteMiddleware((to, from) => {
const { status, data } = useAuth();
if (status.value !== 'authenticated') {
return navigateTo('/auth/login?callbackUrl=' + to.fullPath);
}
if (!data.value?.user?.is_admin) {
return navigateTo('/');
}
});