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

x/otpauth/dist/otpauth.umd.min.js>HOTP#validate

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

Validates an HOTP token.

Parameters

unnamed 0: { token: string; counter?: 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.