yeojz / otplib

:key: One Time Password (OTP) / 2FA for Node.js and Browser - Supports HOTP, TOTP and Google Authenticator

Home Page:https://otplib.yeojz.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we use Bcript.hash() to generate secret?

jprumekso opened this issue · comments

I use the user's hashed password generated by Bcript.hash(password, 10) as totp secret. The thing is totp.check() isn't guaranteed to return true even if the token is right. Is that Bcrypt hashed secret the reason?