UNPKG

techveda-react-auth

Version:

Techveda's React Authentication Library with context and hooks

17 lines (16 loc) 407 B
export interface User { id: string; email?: string; role?: string; permissions?: string[]; [key: string]: any; } export interface AuthContextType { user: User | null; login: (userData: User) => void; logout: () => Promise<void>; isAuthenticated: boolean; loading: boolean; hasRole: (role: string) => boolean; hasPermission: (permission: string) => boolean; }