mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat: add auth, RBAC, admin panel, and JWT-protected routes
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
export interface Permission {
|
||||
id: number
|
||||
name: string
|
||||
description?: string
|
||||
isSystem: boolean
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
id: number
|
||||
name: string
|
||||
description?: string
|
||||
isSuperuser: boolean
|
||||
isSystem: boolean
|
||||
permissions: Permission[]
|
||||
}
|
||||
|
||||
export interface AuthUser {
|
||||
id: number
|
||||
username: string
|
||||
name: string
|
||||
email?: string
|
||||
active: boolean
|
||||
isDefaultPassword: boolean
|
||||
settings: Record<string, unknown>
|
||||
roles: Role[]
|
||||
permissions: string[] // flat list; '*' means superuser
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
accessToken: string
|
||||
user: AuthUser
|
||||
}
|
||||
|
||||
export interface RefreshResponse {
|
||||
accessToken: string
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
id: number
|
||||
createdAt: string
|
||||
expiresAt: string
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './auth'
|
||||
|
||||
Reference in New Issue
Block a user