完成了config文件,初步修正了model的一些问题
This commit is contained in:
11
service/auth.py
Normal file
11
service/auth.py
Normal 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)
|
Reference in New Issue
Block a user