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

Google Auth app not accepting auth token seed #109

Open programmrz opened 6 years ago

programmrz commented 6 years ago

I generate the token and save it to my DB as this with var secret = speakeasy.generateSecret(); console.log(secret.base32); QRCode.toDataURL(secret.otpauth_url, function(err, data_url){ const registerUserQuery =INSERT INTO users (username, 2FASeed, seedURL) VALUES ('${username}', '${secret.base32}', ${data_url}) mySqlConnection.query(registerUserQuery, registrationCallback) }); When I pull the url and scan it to Google Auth, it says the token is invalid. I manually inutted the token into https://chrome.google.com/webstore/detail/authenticator/bhghoamapcdpbohphigoooaddinpkbai and it generates the correct code. What am I doing wrong?