backend
This commit is contained in:
commit
d7666f7b2c
44 changed files with 2246 additions and 0 deletions
11
backend/core/hashing.py
Normal file
11
backend/core/hashing.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from passlib.context import CryptContext
|
||||
|
||||
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
||||
|
||||
def verify_password(plain_password: str, hashed_password: str) -> bool:
|
||||
"""Vérifie si un mot de passe clair correspond à un mot de passe haché."""
|
||||
return pwd_context.verify(plain_password, hashed_password)
|
||||
|
||||
def get_password_hash(password: str) -> str:
|
||||
"""Hache un mot de passe clair."""
|
||||
return pwd_context.hash(password)
|
Loading…
Add table
Add a link
Reference in a new issue