mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-02-07 07:03:19 +08:00
46 lines
727 B
TypeScript
46 lines
727 B
TypeScript
/**
|
|
* Authentication related type definitions
|
|
*/
|
|
|
|
// User info
|
|
export interface User {
|
|
id: number
|
|
username: string
|
|
isStaff: boolean
|
|
isSuperuser: boolean
|
|
}
|
|
|
|
// Login request
|
|
export interface LoginRequest {
|
|
username: string
|
|
password: string
|
|
}
|
|
|
|
// Login response
|
|
export interface LoginResponse {
|
|
message: string
|
|
user: User
|
|
}
|
|
|
|
// Get current user response
|
|
export interface MeResponse {
|
|
authenticated: boolean
|
|
user: User | null
|
|
}
|
|
|
|
// Logout response
|
|
export interface LogoutResponse {
|
|
message: string
|
|
}
|
|
|
|
// Change password request
|
|
export interface ChangePasswordRequest {
|
|
oldPassword: string
|
|
newPassword: string
|
|
}
|
|
|
|
// Change password response
|
|
export interface ChangePasswordResponse {
|
|
message: string
|
|
}
|