From 57432d507ca6656433e0b119c1d1ceab4644e1dd Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 12:04:10 +0100 Subject: [PATCH] Update code in endpoints/logout.post.py --- endpoints/logout.post.py | 12 ++++++++++++ 1 file changed, 12 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..5f0b833 --- /dev/null +++ b/endpoints/logout.post.py @@ -0,0 +1,12 @@ +# Entity: User + +from fastapi import APIRouter, Depends, status +from core.security import logout_user +from core.auth import get_current_user + +router = APIRouter() + +@router.post("/logout", status_code=status.HTTP_200_OK) +async def logout(user=Depends(get_current_user)): + logout_user(user) + return {"message": "Logged out successfully"} \ No newline at end of file