Skip to main content

Type Alias: StoredOneTimeToken

StoredOneTimeToken = object

Defined in: auth-core/src/emailAuthTypes.ts:83

A persisted one-time token. Only the hash is stored, so a store dump yields nothing redeemable.

email is carried alongside userId because the code flow can mint a token for an address that has no user row yet, and because a wrong code has to be counted against a record found by address rather than by its own hash.

Properties

attempts?

optional attempts?: number

Defined in: auth-core/src/emailAuthTypes.ts:95

Wrong guesses recorded so far. Only meaningful for emailCode, whose short keyspace has to be defended by a bounded attempt count.


email

email: string

Defined in: auth-core/src/emailAuthTypes.ts:86

Normalized address the token was mailed to.


expires

expires: Date

Defined in: auth-core/src/emailAuthTypes.ts:90


purpose

purpose: OneTimeTokenPurpose

Defined in: auth-core/src/emailAuthTypes.ts:89


tokenHash

tokenHash: string

Defined in: auth-core/src/emailAuthTypes.ts:84


userId

userId: string | null

Defined in: auth-core/src/emailAuthTypes.ts:88

null when the token was minted before the user row existed.