Skip to content

otplib API Documentation / @otplib/core / validatePeriod

Function: validatePeriod()

validatePeriod(period, guardrails): void

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

Validate period value

Parameters

period

number

The period in seconds to validate

guardrails

OTPGuardrails = DEFAULT_GUARDRAILS

Validation guardrails (defaults to RFC recommendations)

Returns

void

Throws

If period is too small

Throws

If period is too large

Released under the MIT License.