mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-12 12:00:37 +08:00
Changing verify_password so it works like verify_and_update_password. Currently verify_password was not only creating a hmac hash but also encrypting (encrypt_password is first hmac-signing and then encrypting).
Removed unneccessary and wrong tests.
This commit is contained in:
@@ -111,7 +111,10 @@ def verify_password(password, password_hash):
|
||||
:param password: A plaintext password to verify
|
||||
:param password_hash: The expected hash value of the password (usually form your database)
|
||||
"""
|
||||
return _pwd_context.verify(encrypt_password(password), password_hash)
|
||||
if _security.password_hash != 'plaintext':
|
||||
password = get_hmac(password)
|
||||
|
||||
return _pwd_context.verify(password, password_hash)
|
||||
|
||||
|
||||
def verify_and_update_password(password, user):
|
||||
|
||||
Reference in New Issue
Block a user