Fix backend bugs: password hash column rename, dynamic import, AuditLog response_model, websocket reference, missing exports, bcrypt version pin

This commit is contained in:
2026-07-18 05:14:37 +00:00
parent 86c12376f8
commit 312ac27f88
8 changed files with 87 additions and 80 deletions
+4 -2
View File
@@ -4,6 +4,8 @@ from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from typing import Optional
from datetime import datetime
from app.core.database import get_db
from app.core.security import (
verify_password,
@@ -33,7 +35,7 @@ async def login(request: LoginRequest, db: AsyncSession = Depends(get_db)):
result = await db.execute(stmt)
user = result.scalar_one_or_none()
if not user or not verify_password(request.password, user.password_sha512):
if not user or not verify_password(request.password, user.password_hash):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid username or password",
@@ -120,7 +122,7 @@ async def register(request: UserCreate, db: AsyncSession = Depends(get_db)):
# Create new user
new_user = User(
username=request.username,
password_sha512=hash_password(request.password),
password_hash=hash_password(request.password),
salt="random_salt", # In production, generate random salt
email=request.email,
country=request.country,