feat: implement auth system, passkeys, and user management
Add PostgreSQL and Redis integration for users and sessions Implement password and WebAuthn passkey login flows Add Docker stack, super-admin seeding, and protected routes
This commit is contained in:
16
app/middleware/super-admin.ts
Normal file
16
app/middleware/super-admin.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export default defineNuxtRouteMiddleware(async () => {
|
||||
const auth = useAuth()
|
||||
await auth.fetchSession()
|
||||
|
||||
if (!auth.user.value) {
|
||||
return navigateTo('/login')
|
||||
}
|
||||
|
||||
if (auth.needsOnboarding.value) {
|
||||
return navigateTo('/security')
|
||||
}
|
||||
|
||||
if (!auth.isSuperAdmin.value) {
|
||||
return navigateTo('/security')
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user