New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bcrypt.compare return false always. #685
Comments
Character encoding? Could that be an issue? |
Thank you for the response, the problem seems to be related to the amount of characters, the length must be 60 in order to work. |
i've the same issue with v10.13.0, on v8 works like normal |
and how can we resolve that? 61 it's not a pattern ? when we use the bcrypt-generator it generates the sameu number |
This seems to be a continuing issue are there any updates to specific issue? |
In all cases the issue has been with the user input, character encoding, or supplying invalid hashes. We do not throw an error for a malformed bcrypt hash. This is something what I think we should be revisiting. |
My Character length is 255 in DB, Also before data stored in DB it returns true but at the time of checking again after store (i..e. value from DB) it returns false I checked both strings plain and hash from both sides (i.e. from request and from DB) |
Solved to me with the hack from #849 (comment) const hashPass = /^\$2y\$/.test(user.password) ? '$2a$' + user.password.slice(4) : user.password; |
node v: v10.13.0
"bcrypt": "^3.0.2"
I console log the passwords and the hash to check if I was doing something wrong, also tried to create the hash with
'${req.body.password}'
but nothings seems to be working.thanks !
the bcrypt.compare returns false always, when tries to compare hash from the db with the string password.
The text was updated successfully, but these errors were encountered: