Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/otpauth/dist/otpauth.d.cts>TOTP#validate

One Time Password (HOTP/TOTP) library for Node.js, Deno, Bun and browsers.
Go to Latest
method TOTP.prototype.validate
import { TOTP } from "https://deno.land/x/otpauth@v9.3.3/dist/otpauth.d.cts";

Validates a TOTP token.

Parameters

unnamed 0: { token: string; timestamp?: number | undefined; window?: number | undefined; }

Configuration options.

Returns

number | null

Token delta or null if it is not found in the search window, in which case it should be considered invalid.