Last active
December 21, 2022 00:28
-
-
Save janstuemmel/52609dfd535ae0e83894678f6cad5db1 to your computer and use it in GitHub Desktop.
When does a 2fa (totp) token expire...
This file contains 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 period = 30; | |
const epoch = Math.floor(Date.now() / 1000.0); | |
const expires = (Math.ceil(epoch / period) * period) - epoch; | |
console.log(expires); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment