79150822

Date: 2024-11-02 14:04:01
Score: 2
Natty:
Report link

Special thanks to @hoangdv's. Thanks to him, I realized that I was using bcrypt.compareSync() wrongly: because the first two parameters of the method are the non-encrypted password and the encrypted password. Instead, I was inserting as parameters the password I was encrypting in the client side and then the DB password.

So, as @hoangdv said, I should delete formData.userPwd = this.encryptPassword(formData.userPwd); in the client side. And it worked!

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (0.5): Thanks
  • Whitelisted phrase (-1): it worked
  • Has code block (-0.5):
  • User mentioned (1): @hoangdv's
  • User mentioned (0): @hoangdv
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Sithila Somaratne