Skip to content

Commit

Permalink
Use bcrypt's built-in function for checking the password hash
Browse files Browse the repository at this point in the history
  • Loading branch information
bliepp committed Nov 22, 2023
1 parent d906452 commit 35ae21e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_bcrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,5 @@ def check_password_hash(self, pw_hash, password):
if self._handle_long_passwords:
password = hashlib.sha256(password).hexdigest()
password = self._unicode_to_bytes(password)

return hmac.compare_digest(bcrypt.hashpw(password, pw_hash), pw_hash)
return bcrypt.checkpw(password, pw_hash)

0 comments on commit 35ae21e

Please sign in to comment.