完成了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

View File

@@ -1,5 +1,4 @@
from .user import User
from .auth import get_password_hash, verify_password
from .database import init_db
__all__ = ["User", "get_password_hash", "verify_password", "init_db"]
__all__ = ["User", "init_db"]

View File

@@ -1,11 +0,0 @@
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)