ds-free-api / web /src /lib /auth-context.ts
heyeyydss's picture
Upload 154 files
69f686e verified
Raw
History Blame
406 Bytes
import { createContext } from 'react';
interface AuthContextType {
token: string | null;
login: (password: string) => Promise<{ success: boolean; error?: string }>;
setup: (password: string) => Promise<{ success: boolean; error?: string }>;
logout: () => void;
isAuthenticated: boolean;
}
export const AuthContext = createContext<AuthContextType | null>(null);
export type { AuthContextType };