Update code in endpoints/logout.post.py

This commit is contained in:
Backend IM Bot 2025-03-21 17:02:28 +01:00
parent 0d81bb6f35
commit 991d776382

View File

@ -9,11 +9,10 @@ async def logout_handler(
db: Session = Depends(get_db)
):
"""Demo logout endpoint"""
user = get_user_from_token(token, db)
user = get_user_by_token(token, db)
if not user:
raise HTTPException(status_code=401, detail="Invalid authentication credentials")
# Invalidate token or perform logout logic here
fake_users_db[user["username"]]["disabled"] = True
return {