Backend totalmente hecho con mongodb, añadida la funcionalidad de usuarios con historial

This commit is contained in:
Mireya Cueto Garrido
2026-03-27 11:16:44 +01:00
parent 57b64b4f1e
commit e19e971cd6
15 changed files with 252 additions and 89 deletions
+16
View File
@@ -0,0 +1,16 @@
import secrets
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def hash_password(password: str) -> str:
return pwd_context.hash(password)
def verify_password(plain_password: str, hashed_password: str) -> bool:
return pwd_context.verify(plain_password, hashed_password)
def generate_token() -> str:
return secrets.token_hex(32) # 64 caracteres seguros