добавлена аутентификация и сессии в redis

This commit is contained in:
2026-10-07 23:18:23 +03:00
parent 789bea2f1e
commit 7f8bcfd234
9 changed files with 389 additions and 114 deletions
+16
View File
@@ -0,0 +1,16 @@
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
password_hasher = PasswordHasher()
def hash_password(password: str) -> str:
return password_hasher.hash(password)
def verify_password(password_hash: str, password: str) -> bool:
try:
return password_hasher.verify(password_hash, password)
except VerifyMismatchError:
return False