All checks were successful
Build and Deploy LSFE Frontend / build-and-deploy (push) Successful in 4m36s
41 lines
779 B
TypeScript
41 lines
779 B
TypeScript
export interface LoginRequest {
|
|
userName: string;
|
|
password: string;
|
|
}
|
|
|
|
export interface LoginResponse {
|
|
token: string;
|
|
userClaims: UserClaim[];
|
|
userRole: string;
|
|
message?: string;
|
|
error?: string;
|
|
}
|
|
|
|
export interface UserClaim {
|
|
type: string;
|
|
value: string;
|
|
}
|
|
|
|
export interface AuthUser {
|
|
userId: string;
|
|
userName: string;
|
|
fullName: string;
|
|
userRole: string;
|
|
company: string;
|
|
userClaims: UserClaim[];
|
|
token: string;
|
|
}
|
|
|
|
export interface AuthContextType {
|
|
user: AuthUser | null;
|
|
isAuthenticated: boolean;
|
|
isLoading: boolean;
|
|
login: (authData: Omit<AuthUser, 'userName'> & { userName: string }) => Promise<void>;
|
|
logout: () => void;
|
|
}
|
|
|
|
export interface AuthState {
|
|
user: AuthUser | null;
|
|
isAuthenticated: boolean;
|
|
isLoading: boolean;
|
|
} |