speakeasyjs / speakeasy

**NOT MAINTAINED** Two-factor authentication for Node.js. One-time passcode generator (HOTP/TOTP) with support for Google Authenticator.
MIT License
2.7k stars 228 forks source link

TOTP verification failure #140

Open ragul-ct opened 3 years ago

ragul-ct commented 3 years ago

Why do sometimes speakeasy.totp.verify() method return false even though the secret and token matches.

Can anyone tell me if there is any issue with the way i use it?

Below is my implementation to create a token and verify a token

speakeasy.totp({ secret, encoding: 'base32', digits: 4, step: 600 });

speakeasy.totp.verify({ secret, token, encoding: 'base32', step: 600, digits: 4 });

wouterschiedam commented 3 years ago

Did you find a fix for this?

sabdullahpear commented 2 years ago

Seeing the same issue.