Represents the authentication context type for React context providers.

export interface AuthContextType {
authState: AuthState;
login: (credentials: APICredentials) => Promise<void>;
logout: () => void;
isLoading: boolean;
error: string | null;
statusMessage: string | null;
setCredentialSource: (source: "default" | "custom") => void;
updateCustomCredentials: (
clientId: string,
clientSecret: string,
redirectUri: string,
) => void;
customCredentials: APICredentials | null;
}
interface AuthContextType {
    authState: AuthState;
    login: (credentials: APICredentials) => Promise<void>;
    logout: () => void;
    isLoading: boolean;
    error: null | string;
    statusMessage: null | string;
    setCredentialSource: (source: "default" | "custom") => void;
    updateCustomCredentials: (
        clientId: string,
        clientSecret: string,
        redirectUri: string,
    ) => void;
    customCredentials: null | APICredentials;
}

Properties

authState: AuthState

The current authentication state.

login: (credentials: APICredentials) => Promise<void>

Function to log in with credentials.

logout: () => void

Function to log out the user.

isLoading: boolean

Whether an authentication operation is in progress.

error: null | string

The current authentication error message, if any.

statusMessage: null | string

The current status message, if any.

setCredentialSource: (source: "default" | "custom") => void

Function to set the credential source.

updateCustomCredentials: (
    clientId: string,
    clientSecret: string,
    redirectUri: string,
) => void

Function to update custom credentials.

customCredentials: null | APICredentials

The current custom credentials, if any.