jeremyscalpello / node-2fa

Easy 2-Factor Integration For Node.JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Always returning Delta: -1

opened this issue · comments

I generate a secret and token and send the token in an email, when the token from the email is put into a webpage form and submitted, i then retrieve the secret from the database and validate the token, and I do this within 30 seconds of sending the token, and I always get a delta -1. I set the window to 10 even and it still returns -1, what am I missing??

I'm running the code in a simple express app

Turns out I was just outside the 30 second step, so I was getting delta -1

Also stating default window to 4 means only 2 mins as the steps are 30 seconds, so it goes up to delta -4 then null afterwards