From 958bc8eecc7f173e2a8d52233e098b51d1a6ec1d Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sat, 29 Mar 2025 11:40:49 +0000 Subject: [PATCH] Update code in endpoints/logouts.post.py --- endpoints/logouts.post.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 endpoints/logouts.post.py diff --git a/endpoints/logouts.post.py b/endpoints/logouts.post.py new file mode 100644 index 0000000..4cc4e7d --- /dev/null +++ b/endpoints/logouts.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.user import User +from schemas.user import UserSchema +from helpers.auth_helpers import logout_user + +router = APIRouter() + +@router.post("/logouts", status_code=200) +async def logout( + db: Session = Depends(get_db) +): + """Logout user""" + logout_user(db) + return {"message": "Successfully logged out"} \ No newline at end of file