UNPKG

@duongtrungnguyen/next-helper

Version:
17 lines 1.07 kB
import type { AuthContextType } from "./types"; /** * AuthContext provides authentication state and methods for managing user authentication. * * @type {AuthContextType} * @property {object} state - The current authentication state. * @property {object|null} state.user - The authenticated user object, or null if not authenticated. * @property {boolean} state.isLoading - Indicates if the authentication process is currently loading. * @property {boolean} state.isAuthenticated - Indicates if the user is authenticated. * @property {object|null} state.error - Any error that occurred during authentication, or null if no error. * @property {Function} login - Asynchronous function to log in a user. * @property {Function} logout - Asynchronous function to log out the current user. * @property {Function} refreshTokens - Asynchronous function to refresh authentication tokens. * @returns {boolean} - Returns false if token refresh fails. */ export declare const AuthContext: import("react").Context<AuthContextType>; //# sourceMappingURL=context.d.ts.map