From f14ab3bd90fb0f811531c1ec867a0786f87e32fc Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 11:44:51 -0500 Subject: [PATCH] Update code in endpoints/logout.post.py --- endpoints/logout.post.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 endpoints/logout.post.py diff --git a/endpoints/logout.post.py b/endpoints/logout.post.py new file mode 100644 index 0000000..5a9c531 --- /dev/null +++ b/endpoints/logout.post.py @@ -0,0 +1,11 @@ +from fastapi import APIRouter, Depends, HTTPException, status +from core.security import logout_user +from core.auth import get_current_active_user + +router = APIRouter() + +@router.post("/logout", status_code=200) +async def logout(current_user=Depends(get_current_active_user)): + """Logout user""" + logout_user(current_user) + return {"message": "Logged out successfully"} \ No newline at end of file