Fix ban screen

This commit is contained in:
2025-12-20 23:59:13 +07:00
parent 6c824712c9
commit 95e2a77335
5 changed files with 44 additions and 11 deletions

View File

@@ -59,9 +59,15 @@ async def login(request: Request, data: UserLogin, db: DbSession):
# Check if user is banned
if user.is_banned:
# Return full ban info like in deps.py
ban_info = {
"banned_at": user.banned_at.isoformat() if user.banned_at else None,
"banned_until": user.banned_until.isoformat() if user.banned_until else None,
"reason": user.ban_reason,
}
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="Your account has been banned",
detail=ban_info,
)
# If admin with Telegram linked, require 2FA