You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
644 B
37 lines
644 B
export enum UserRole {
|
|
ADMIN,
|
|
REGULAR,
|
|
}
|
|
|
|
export interface UserEntity {
|
|
_id: string
|
|
name: string
|
|
email: string
|
|
role: UserRole
|
|
}
|
|
export interface AuthState {
|
|
loading: boolean
|
|
user: UserEntity | null
|
|
accessToken: string | null
|
|
}
|
|
|
|
export interface LoginRequestPayload {
|
|
email: string
|
|
password: string
|
|
}
|
|
|
|
export interface RegisterRequestPayload extends LoginRequestPayload {
|
|
name: string
|
|
}
|
|
|
|
export interface BaseResponse {
|
|
success?: boolean
|
|
error?: string
|
|
message?: string
|
|
}
|
|
export interface LoginResponse extends BaseResponse {
|
|
accessToken: string
|
|
user: UserEntity
|
|
}
|
|
|
|
export type RegisterResponse = LoginResponse
|