Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/security / / rekeyTokens

Function: rekeyTokens()

ts
function rekeyTokens(options): Promise<ReadonlyMap<string, CreatedToken>>;

Defined in: packages/security/src/auth/crud.ts:234

Re-issue every active token. Used after a known compromise: the previous tokens are revoked and replaced with fresh raw values using the same scopes / labels.

Returns the new tokens keyed by their old id so the caller can route the rotated raws back to the right user.

Parameters

ParameterType
options{ env: string; now?: () => number; pepper: SecretValue; prefix?: string; tokenStore: AuthTokenStore; }
options.envstring
options.now?() => number
options.pepperSecretValue
options.prefix?string
options.tokenStoreAuthTokenStore

Returns

Promise<ReadonlyMap&lt;string, CreatedToken&gt;>

Stable