diff --git a/flask_security/utils.py b/flask_security/utils.py index 66d0f57..7397ab4 100644 --- a/flask_security/utils.py +++ b/flask_security/utils.py @@ -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())