speakeasy icon indicating copy to clipboard operation
speakeasy copied to clipboard

Generated 2FA code is invalid and different from google Authenicator app

Open Mobeen-Ghaffar opened this issue 1 year ago • 3 comments

Here is my Code:


 var userToken = speakeasy.totp({
          secret: screte_code,
          digits: 6,
          encoding: 'base32',
          algorithm: 'sha1',
          // encoding: 'base32'
        });
        var verified = speakeasy.totp.verify(
          {
            secret: screte_code,
            encoding: 'base32',
            token: userToken,
          }
        );

Sometime it generate correct code and sometime incorrect. How can I fix this issue? What I am doing wrong ?

Mobeen-Ghaffar avatar Feb 12 '24 09:02 Mobeen-Ghaffar

+1 I'm actually never getting the same code with GoogleAuth - this lib seems to be working fine, but it never generates matching code

EDIT: Ah now I see this is unmaintened... sorry.

davidhorac3 avatar Jun 28 '24 11:06 davidhorac3

+1 I also facing the same issue , it is working 90% user but for 10% it is not working.

rutvik-mpc avatar Jul 11 '24 06:07 rutvik-mpc