From 36ebb66e9c028c191ef6bfbbc852e9c5b58450a3 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 11:23:22 +0100 Subject: [PATCH] Update code in endpoints/logout.post.py --- endpoints/logout.post.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/endpoints/logout.post.py b/endpoints/logout.post.py index 91b2c5b..1b0f199 100644 --- a/endpoints/logout.post.py +++ b/endpoints/logout.post.py @@ -1,17 +1,11 @@ # Entity: User from fastapi import APIRouter, Depends, status -from sqlalchemy.orm import Session -from core.database import get_db -from models.user import User -from schemas.user import UserSchema -from helpers.user_helpers import logout_user +from core.auth import logout_user +from schemas.user import UserLogoutSchema router = APIRouter() -@router.post("/logout", status_code=200) -async def logout( - db: Session = Depends(get_db) -): - logout_user(db) +@router.post("/logout", status_code=200, response_model=UserLogoutSchema) +async def logout(user=Depends(logout_user)): return {"message": "Logged out successfully"} \ No newline at end of file