This commit is contained in:
mangomqy
2025-11-13 02:54:06 +00:00
commit c5e51ed069
254 changed files with 54901 additions and 0 deletions

View File

@ -0,0 +1,23 @@
/**
* Auth Context
* Authentication context - separated for Fast Refresh compatibility
*/
import { createContext } from "react";
import type { AuthResponse } from "@/api";
export interface User {
username: string;
role?: string;
}
export interface AuthContextType {
token: string | null;
user: User | null;
isAuthenticated: boolean;
login: (response: AuthResponse) => void;
logout: () => void;
}
export const AuthContext = createContext<AuthContextType | undefined>(undefined);