feat: implement auth middleware, user sync, and token state persistence

- Define useAuth composable logic with syncUser, handleLoginSuccess, and logout methods
- Add auth.ts and guest.ts route middlewares to guard routes based on authentication and user roles
- Add auth.client.ts plugin to boot-sync logged in user details
- Declare custom PageMeta type definitions to support role-based authorization rules
This commit is contained in:
2026-06-12 19:04:19 +02:00 Unverified
parent 834fdade2b
commit 7499ca60f6
5 changed files with 138 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
declare module '#app' {
interface PageMeta {
auth?: {
role?: 'CITIZEN' | 'OPERATOR' | 'ADMIN'
}
}
}
export {}