14 lines
357 B
Python
14 lines
357 B
Python
import argon2
|
|
|
|
|
|
class Argon2PasswordHasher(argon2.PasswordHasher):
|
|
def verify(self, password_hash: str | bytes, password: str | bytes) -> bool:
|
|
try:
|
|
super().verify(password_hash, password)
|
|
return True
|
|
except argon2.exceptions.VerifyMismatchError:
|
|
return False
|
|
|
|
|
|
argon2_hasher = Argon2PasswordHasher()
|