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