Function
_verify_password
(password: str, salt: str, password_hash: str)
Source from the content-addressed store, hash-verified
| 5 | |
| 6 | |
| 7 | def _verify_password(password: str, salt: str, password_hash: str): |
| 8 | password_hash_bytes = password_hash.encode("utf-8") |
| 9 | salt_bytes = salt.encode("utf-8") |
| 10 | re_hashed_password = bcrypt.hashpw(password.encode("utf-8"), salt_bytes) |
| 11 | if password_hash_bytes == re_hashed_password: |
| 12 | return True |
| 13 | else: |
| 14 | return False |
| 15 | |
| 16 | |
| 17 | async def login_admin(admin: Admin, password: str): |
Tested by
no test coverage detected