feat : ajout d'un système de rôle => admin/personnel/sites

This commit is contained in:
2026-02-13 09:07:52 +01:00
parent 4845230429
commit 5fe35092c2
19 changed files with 965 additions and 40 deletions

View File

@@ -0,0 +1,12 @@
export default defineNuxtRouteMiddleware(async () => {
const auth = useAuthStore()
if (!auth.checked) {
await auth.ensureSession()
}
const isAdmin = auth.user?.roles?.includes('ROLE_ADMIN')
if (!isAdmin) {
return navigateTo('/')
}
})