Ajouter Dockerfile, requirements.txt, et mettre à jour les imports dans models.py et security.py

This commit is contained in:
Pierre Berthe 2024-04-12 10:46:48 +02:00
parent 26020ecbc1
commit c6579868d7
4 changed files with 41 additions and 6 deletions

View file

@ -1,11 +1,9 @@
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["argon2"])
from passlib.hash import argon2
def hash_password(password: str | bytes):
return pwd_context.hash(password)
return argon2.hash(password)
def verify_password(password: str | bytes, hashed_password: str):
return pwd_context.verify(password, hashed_password)
return argon2.verify(password, hashed_password)