react-sanctum
Version:
Easily hook up your React app to Laravel Sanctum
16 lines (15 loc) • 590 B
TypeScript
import * as React from "react";
export interface ContextProps {
user: null | any;
authenticated: null | boolean;
signIn: (username: string, password: string, remember?: boolean) => Promise<{
twoFactor: boolean;
signedIn: boolean;
}>;
signOut: () => Promise<void>;
twoFactorChallenge: (code: string, recovery?: boolean) => Promise<{}>;
setUser: (user: object, authenticated?: boolean) => void;
checkAuthentication: () => Promise<boolean>;
}
declare const SanctumContext: React.Context<ContextProps | undefined>;
export default SanctumContext;