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

x/otpauth/dist/otpauth.slim.esm.min.js>TOTP#validate

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

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.