Created
March 12, 2020 09:11
-
-
Save ryanhs/9c1ce91d79501d3bfb667e6cb766d2ce to your computer and use it in GitHub Desktop.
totp.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { totp } = require('otplib') | |
const secret = 'SOMESECRETCODE'; | |
totp.options = { window: 0, step: 5 } | |
token = totp.generate(secret); | |
totp.verify({ token, secret }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to make it 60s window, past generation can be checked, change window to 60
totp.options = { window: 60, step: 5 }