Lager - v5.2.0
    Preparing search index...

    Defines the contexts for authentication operations within the application.

    This interface provides the structure for the authentication contexts, which manages user state and authentication operations such as login, logout, and registration.

    AuthContextType

    interface AuthContextType {
        isLoggedIn: boolean;
        login: (username: string, password: string) => Promise<boolean>;
        logout: () => Promise<void>;
        register: (username: string, password: string) => Promise<void>;
        setIsLoggedIn: (authIndicator: boolean) => void;
        setUser?: (user: User) => void;
        user?: User;
    }
    Index

    Properties

    isLoggedIn: boolean

    Boolean indicating if a user is currently logged in.

    login: (username: string, password: string) => Promise<boolean>

    Async function to handle user login.

    logout: () => Promise<void>

    Async function to handle user logout.

    register: (username: string, password: string) => Promise<void>

    Async function to handle user registration.

    setIsLoggedIn: (authIndicator: boolean) => void

    Function to update the login state.

    setUser?: (user: User) => void

    Function to update the current user state.

    user?: User

    The current user object or undefined if no user is logged in.