feat : ajout de l'authentification avec lexik

This commit is contained in:
2026-01-19 15:17:43 +01:00
parent 42fafc5d39
commit ce49785c79
33 changed files with 932 additions and 43 deletions

View File

@@ -0,0 +1,17 @@
import { useAuthStore } from '~/stores/auth'
export default defineNuxtRouteMiddleware(async (to) => {
const auth = useAuthStore()
if (to.path === '/login') {
return
}
if (!auth.isAuthenticated) {
await auth.ensureSession()
}
if (!auth.isAuthenticated) {
return navigateTo('/login')
}
})