- 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
8 lines
127 B
TypeScript
8 lines
127 B
TypeScript
declare module '#app' {
|
|
interface PageMeta {
|
|
auth?: {
|
|
role?: 'CITIZEN' | 'OPERATOR' | 'ADMIN'
|
|
}
|
|
}
|
|
}
|
|
export {} |