hectorm / otpauth

One Time Password (HOTP/TOTP) library for Node.js, Deno, Bun and browsers.
https://hectorm.github.io/otpauth/
MIT License
971 stars 56 forks source link

Set default value to HOTP.validate({digits}) #550

Closed floriannari closed 1 month ago

floriannari commented 1 month ago

For example, HOTP.generate({digits}) has HOTP.defaults.digits (i.e. 6) for default value. But for HOTP.validate({digits}), we have to define digits: 6.

I suggest that the “digits” parameter of the “validate” function also use HOTP.defaults.digits for default value.

Thanks

hectorm commented 1 month ago

Sounds reasonable, I just did it. Thanks!