Update code in endpoints/logout.post.py

This commit is contained in:
Backend IM Bot 2025-03-28 10:49:34 +01:00
parent de1d097341
commit 5dd976e574

View File

@ -1,6 +1,6 @@
# Entity: User # Entity: User
from fastapi import APIRouter, Depends, HTTPException, status from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from core.database import get_db from core.database import get_db
from models.user import User from models.user import User
@ -11,7 +11,8 @@ router = APIRouter()
@router.post("/logout", status_code=200) @router.post("/logout", status_code=200)
async def logout( async def logout(
db: Session = Depends(get_db) db: Session = Depends(get_db),
current_user: User = Depends(get_current_user)
): ):
logout_user(db) logout_user(db, current_user)
return {"message": "Logged out successfully"} return {"message": "Logged out successfully"}