Authentication actions exposed through context.

Operation Queuing Note: This layer implements queuing for critical auth operations while offline. Operations dequeue when connectivity restores. Failed sync-level operations are managed by useSynchronization hook (see storage.ts).

export interface AuthActionsContextValue {
login: (credentials: ApiCredentials) => Promise<void>;
refreshToken: () => Promise<void>;
logout: () => void;
cancelAuth: () => Promise<void>;
setCredentialSource: (source: "default" | "custom") => void;
updateCustomCredentials: (
clientId: string,
clientSecret: string,
redirectUri: string,
) => void;
enqueueWhenOnline: (taskId: string, fn: () => Promise<void>) => void;
}
interface AuthActionsContextValue {
    login: (credentials: ApiCredentials) => Promise<void>;
    refreshToken: () => Promise<void>;
    logout: () => void;
    cancelAuth: () => Promise<void>;
    setCredentialSource: (source: "default" | "custom") => void;
    updateCustomCredentials: (
        clientId: string,
        clientSecret: string,
        redirectUri: string,
    ) => void;
    enqueueWhenOnline: (taskId: string, fn: () => Promise<void>) => void;
}

Hierarchy (View Summary)

Properties

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

Log in with credentials.

refreshToken: () => Promise<void>

Refresh the authentication token.

logout: () => void

Log out the user.

cancelAuth: () => Promise<void>

Cancel an in-progress auth flow.

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

Set the credential source.

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

Update custom credentials.

enqueueWhenOnline: (taskId: string, fn: () => Promise<void>) => void

Queue a task for execution when online (with deduplication).