LSFE-Frontend/src/types/auth.ts
rowell_m_soriano f568a8aa14
All checks were successful
Build and Deploy LSFE Frontend / build-and-deploy (push) Successful in 4m36s
for migration to new repo to be able to use the CICD
2026-07-30 13:56:40 +08:00

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;
}