Skip to main content

Function: verifyOneTimeToken()

verifyOneTimeToken(args): boolean

Defined in: oneTimeToken.ts:166

Constant-time check of a plain token against a stored hash, also validating the expiration date.

This is a single-guess check and deliberately keeps no state, so a numeric token needs the caller to bound how many guesses a stored record accepts — createEmailAuthHandlers does that through OneTimeTokenStore.incrementAttempts.

Parameters

ParameterType
args{ expires: Date; token: string; tokenHash: string; }
args.expiresDate
args.tokenstring
args.tokenHashstring

Returns

boolean