add option to set user-password for service when updating its hash

This commit is contained in:
2021-09-05 15:40:03 +03:00
parent 08e0237639
commit 18de70154e
7 changed files with 45 additions and 22 deletions

View File

@ -58,7 +58,7 @@ def test_check_credentials(mapping_auth: MappingAuth, user: User) -> None:
must return true for valid credentials
"""
current_password = user.password
user.password = user.hash_password(user.password, mapping_auth.salt)
user.password = user.hash_password(mapping_auth.salt)
mapping_auth._users[user.username] = user
assert mapping_auth.check_credentials(user.username, current_password)
assert not mapping_auth.check_credentials(user.username, user.password) # here password is hashed so it is invalid