yeojz / otplib

:key: One Time Password (OTP) / 2FA for Node.js and Browser - Supports HOTP, TOTP and Google Authenticator
https://otplib.yeojz.dev
MIT License
1.94k stars 131 forks source link

totp or authenticator #439

Open z3st1k opened 3 years ago

z3st1k commented 3 years ago

Hi! Could you give short explain, why codes, generated by otplib.totp doesn't match with any test 2FA application (chrome extensions, Google Authenticator, other test sites)? It's only work when use otplib.authenticator

TranBaVinhSon commented 3 years ago

I dont know why but generated code by both otplib.authenticator and otplib.totp doesn't match with code from 2FA application

z3st1k commented 3 years ago

I dont know why but generated code by both otplib.authenticator and otplib.totp doesn't match with code from 2FA application

Hmm. Maybe problem in time difference between your application and another 2FA app. otplib.authenticator works for me. What 2FA application did you used? You can try to paste your secret to Google Authenticator (mobile app) and compare. It should works.