Skip to content

Commit

Permalink
Merge pull request #380 from TeskaLabs/patch/v24.17-login-stacktrace
Browse files Browse the repository at this point in the history
Handle Argon2 VerifyMismatchError
  • Loading branch information
byewokko authored May 17, 2024
2 parents a2e0338 + 5d96785 commit 59084a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion seacatauth/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ def argon2_hash(secret: bytes | str) -> str:


def argon2_verify(hash: bytes | str, secret: bytes | str) -> bool:
return argon2.PasswordHasher().verify(hash, secret)
try:
return argon2.PasswordHasher().verify(hash, secret)
except argon2.exceptions.VerifyMismatchError:
return False


def generate_ergonomic_token(length: int):
Expand Down

0 comments on commit 59084a4

Please sign in to comment.