From ce235fb8fcb25ef1c3b29e1e5d8bc7d0dc11a7cc Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sat, 29 Mar 2025 11:39:53 +0000 Subject: [PATCH] Update code in endpoints/logout.post.py --- endpoints/logout.post.py | 16 ++++++++++++++++ 1 file changed, 16 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..d4ebe7c --- /dev/null +++ b/endpoints/logout.post.py @@ -0,0 +1,16 @@ +from fastapi import APIRouter, Depends, HTTPException, status +from sqlalchemy.orm import Session +from core.database import get_db +from models.auth import Auth +from schemas.auth import AuthSchema +from helpers.auth_helpers import logout_user + +router = APIRouter() + +@router.post("/logout", status_code=200) +async def logout( + db: Session = Depends(get_db) +): + """Logout user""" + result = logout_user(db) + return {"message": "Successfully logged out"} \ No newline at end of file