Files
Charon/frontend/src/context/AuthContextValue.ts
2026-01-26 19:22:05 +00:00

20 lines
473 B
TypeScript

import { createContext } from 'react';
export interface User {
user_id: number;
role: string;
name?: string;
email?: string;
}
export interface AuthContextType {
user: User | null;
login: (token?: string) => Promise<void>;
logout: () => void;
changePassword: (oldPassword: string, newPassword: string) => Promise<void>;
isAuthenticated: boolean;
isLoading: boolean;
}
export const AuthContext = createContext<AuthContextType | undefined>(undefined);