feat(front) : modular nuxt config with app/ shell dirs and modules/* layer auto-detection

This commit is contained in:
Matthieu
2026-06-19 15:24:57 +02:00
parent 1aa43a5356
commit b00e92bdd3
7 changed files with 45 additions and 12 deletions
+16
View File
@@ -0,0 +1,16 @@
export default defineNuxtRouteMiddleware(async (to) => {
const auth = useAuthStore()
const isLogin = to.path === '/login'
if (!auth.checked) {
await auth.ensureSession()
}
if (!isLogin && !auth.isAuthenticated) {
return navigateTo('/login')
}
if (isLogin && auth.isAuthenticated) {
return navigateTo('/')
}
})