Class: TransactionStore

TransactionStore(optsopt)

Authorization transactions (state, nonce, PKCE verifier) between the redirect to the OP and the callback. Keyed by state; take() removes the entry as it reads it, so each transaction — and therefore each authorization response — can be used exactly once.

Uses sessionStorage when present (per tab, cleared when the tab closes, survives the round trip to the OP) and memory otherwise.

Constructor

new TransactionStore(optsopt)

Parameters:
Name Type Attributes Description
opts Object <optional>

(TypeScript: { storage?: Storage|null, prefix?: string })

Source:

Classes

TransactionStore

Methods

set(id)

Parameters:
Name Type Description
id string

@param {Record<string, any>} transaction

Source:

sweep(maxAgeMs)

Removes transactions older than maxAgeMs (abandoned sign-ins).

Parameters:
Name Type Description
maxAgeMs number
Source:

take(id) → {Record.<string, any>|undefined}

Reads and removes a transaction.

Parameters:
Name Type Description
id string
Source:
Returns:
Type
Record.<string, any> | undefined