mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-28 16:20:24 +08:00
Merge pull request #88 from andreev-artem/develop
Password should be encoded as 'utf-8' before creating hmac to support passwords with non-latin symbols
This commit is contained in:
@@ -78,7 +78,7 @@ def get_hmac(password):
|
||||
'must not be None when the value of `SECURITY_PASSWORD_HASH` is '
|
||||
'set to "%s"' % _security.password_hash)
|
||||
|
||||
h = hmac.new(_security.password_salt, password, hashlib.sha512)
|
||||
h = hmac.new(_security.password_salt, password.encode('utf-8'), hashlib.sha512)
|
||||
return base64.b64encode(h.digest())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user