@gsarthak783/accesskit-react
Version:
React SDK for AccessKit Authentication System
40 lines • 1.46 kB
TypeScript
import React, { ReactNode } from 'react';
import { AuthClient, User, AuthConfig, TokenStorage } from '@gsarthak783/accesskit-auth';
interface AuthContextType {
user: User | null;
isLoading: boolean;
isAuthenticated: boolean;
login: (email: string, password: string) => Promise<void>;
register: (userData: {
email: string;
password: string;
firstName: string;
lastName: string;
username?: string;
customFields?: Record<string, any>;
}) => Promise<void>;
logout: () => Promise<void>;
updateProfile: (userData: Partial<User>) => Promise<void>;
updatePassword: (currentPassword: string, newPassword: string) => Promise<void>;
updateEmail: (newEmail: string, password: string) => Promise<{
email: string;
isVerified: boolean;
}>;
reauthenticateWithCredential: (password: string) => Promise<{
authenticated: boolean;
authenticatedAt: string;
}>;
requestPasswordReset: (email: string) => Promise<void>;
resetPassword: (token: string, password: string) => Promise<void>;
verifyEmail: (token: string) => Promise<void>;
client: AuthClient;
}
interface AuthProviderProps {
children: ReactNode;
config: AuthConfig;
storage?: TokenStorage;
}
export declare const AuthProvider: React.FC<AuthProviderProps>;
export declare const useAuth: () => AuthContextType;
export {};
//# sourceMappingURL=AuthProvider.d.ts.map