Skip to main content

Function: verifyApiToken()

verifyApiToken(args): boolean

Defined in: apiToken.ts:62

Constant-time check of a plain token against a stored hash, optionally validating expiration.

Parameters

ParameterTypeDescription
args{ expiresAt?: Date | null; token: string; tokenHash: string; }-
args.expiresAt?Date | nullWhen provided, the token is rejected after this date. Omit (or pass null) for tokens that never expire.
args.tokenstring-
args.tokenHashstring-

Returns

boolean