Fix TypeError in call to bcrypt.hashpw

- At the very least, this TypeError caused logins to fail on my own
  running instance of Synapse, and the simple (explicit) UTF-8
  conversion resolved login errors for me.

Signed-off-by: Salvatore LaMendola <salvatore.lamendola@gmail.com>
This commit is contained in:
Salvatore LaMendola 2016-06-16 00:43:42 -04:00
parent 78a16d395c
commit ed5f43a55a
No known key found for this signature in database
GPG key ID: 7D099EDAE590F425

View file

@ -626,6 +626,6 @@ class AuthHandler(BaseHandler):
Whether self.hash(password) == stored_hash (bool). Whether self.hash(password) == stored_hash (bool).
""" """
if stored_hash: if stored_hash:
return bcrypt.hashpw(password, stored_hash) == stored_hash return bcrypt.hashpw(password, stored_hash.encode('utf-8')) == stored_hash
else: else:
return False return False