speakeasyjs / speakeasy

**NOT MAINTAINED** Two-factor authentication for Node.js. One-time passcode generator (HOTP/TOTP) with support for Google Authenticator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google Auth app not accepting auth token seed

programmrz opened this issue · comments

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?