• Accesses the authentication state context.

    Returns AuthStateContextValue

    Authentication state including user, isAuthenticated, and tokens.

    When used outside an AuthProvider.

    export function useAuthState(): AuthStateContextValue {
    const context = useContext(AuthStateContext);
    if (context === undefined) {
    throw new Error("useAuthState must be used within an AuthProvider");
    }
    return context;
    }