react-auth-verification-context
Version:
react-auth-verification-context is a library that provides a way to manage authentication state in a React application. It is implemented using the React context API, which allows you to pass data through the component tree without having to pass props do
21 lines (20 loc) • 528 B
TypeScript
export declare enum AuthActions {
RestoreToken = "RESTORE_TOKEN",
SignIn = "SIGN_IN",
SignOut = "SIGN_OUT",
Loading = "LOADING"
}
export type TAuth = {
isLoading: boolean;
attributes: any;
isAuthenticated: boolean;
login: (a: any) => void;
logout: () => void;
restoreToken: (a: any) => void;
};
export type TCurrentUser = any;
export interface IAuthReducer {
type: AuthActions | '';
payload: any;
}
export declare const authReducer: (state: TAuth, action: IAuthReducer) => TAuth;