Skip to content

otplib API Documentation / @otplib/core / validateToken

Function: validateToken()

validateToken(token, digits): void

Defined in: packages/core/src/utils.ts:329

Validate token

Parameters

token

string

The token string to validate

digits

number

Expected number of digits

Returns

void

Throws

If token has incorrect length

Throws

If token contains non-digit characters

Released under the MIT License.