update
This commit is contained in:
@@ -12,10 +12,10 @@ from sqlalchemy.orm import Session
|
||||
from backend.db import get_db
|
||||
from backend.models import User
|
||||
|
||||
pwd_context = CryptContext(schemes=["argon2"], deprecated="auto")
|
||||
pwd_context = CryptContext(schemes=["argon2", "bcrypt"], deprecated="auto")
|
||||
bearer = HTTPBearer(auto_error=False)
|
||||
|
||||
AUTH_VERSION = "argon2-2026-04-07"
|
||||
AUTH_VERSION = "argon2-bcrypt-compat-2026-04-07"
|
||||
|
||||
|
||||
def _env(name: str, default: str) -> str:
|
||||
@@ -48,6 +48,10 @@ def verify_password(password: str, password_hash: str) -> bool:
|
||||
) from e
|
||||
|
||||
|
||||
def password_needs_update(password_hash: str) -> bool:
|
||||
return pwd_context.needs_update(password_hash)
|
||||
|
||||
|
||||
def create_access_token(*, user_id: str) -> str:
|
||||
now = datetime.now(timezone.utc)
|
||||
payload = {
|
||||
|
||||
Reference in New Issue
Block a user