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

weird behaviour always gets false #137

Open DAmrGharieb opened 3 years ago

DAmrGharieb commented 3 years ago

hi guys hope every thing is going ok

i have a weird problem with speakseasy everything if going ok on my local machine when i uploaded to the iis the verify function always gets false

`app.post("/verifySecret", async (req, res) => { let data = await getSecret(req.body.email); if (data == undefined) { res.send({ "status": 404, "message": "Email account not registered" }); return; }

let valid = { "valid": speakeasy.totp.verify({ secret: data.secret, encoding: "base32", token: req.body.token, window: 0 }), "secret":data.secret, "token":req.body.token }; res.send(valid); });`

i checked everything the secret key come from database the token is working on my local machine but on iis not attached two photos at the same time

2021-04-07 21_34_20-Window 2021-04-07 21_34_39-Window

suprim12 commented 3 years ago

Wasted 2 hr fixing this

Here is your saviour: https://github.com/speakeasyjs/speakeasy/issues/138