完成了config文件,初步修正了model的一些问题

This commit is contained in:
carry
2025-01-20 14:18:33 +08:00
parent 287a1e5629
commit 287e38aa48
3 changed files with 36 additions and 2 deletions

11
service/auth.py Normal file
View File

@@ -0,0 +1,11 @@
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def get_password_hash(password: str) -> str:
"""Generate password hash using bcrypt"""
return pwd_context.hash(password)
def verify_password(plain_password: str, hashed_password: str) -> bool:
"""Verify password against stored hash"""
return pwd_context.verify(plain_password, hashed_password)