Correctly handle NULL password hashes from the database

pull/4/merge
Erik Johnston 9 years ago
parent ae1af262f6
commit 1400bb1663
  1. 3
      synapse/handlers/auth.py

@ -615,4 +615,7 @@ class AuthHandler(BaseHandler):
Returns: Returns:
Whether self.hash(password) == stored_hash (bool). Whether self.hash(password) == stored_hash (bool).
""" """
if stored_hash:
return bcrypt.hashpw(password, stored_hash) == stored_hash return bcrypt.hashpw(password, stored_hash) == stored_hash
else:
return False

Loading…
Cancel
Save