Skip to main content

Interface: TOTPSecret

Defined in: src/auth/types.ts:124

Describes a secret used for TOTP authentication. The digits/period/algorithm parameters are captured at registration time (rather than always deferring to the current TOTPConfig) so a secret keeps verifying correctly even if the relying party's configured defaults change later.

Properties

algorithm?

optional algorithm?: TOTPAlgorithm

Defined in: src/auth/types.ts:131

The HMAC hash algorithm used to generate the associated token, if it differs from the library default.


digits?

optional digits?: number

Defined in: src/auth/types.ts:127

The number of digits the associated token contains, if it differs from the library default.


epochTolerance?

optional epochTolerance?: number | number[]

Defined in: src/auth/types.ts:137

Specifies a tolerance window around the current time. It does not represent a strict duration in seconds (e.g., "±N seconds"), but rather dictates which periods overlap with the tolerance window [currentTime - tolerance, currentTime + tolerance]. Default value is [5, 0].


period?

optional period?: number

Defined in: src/auth/types.ts:129

The time step, in seconds, that the associated token remains valid for, if it differs from the library default.


secret

secret: string

Defined in: src/auth/types.ts:125