diff --git a/endpoints/logout.post.py b/endpoints/logout.post.py index 91b2c5b..ec4a124 100644 --- a/endpoints/logout.post.py +++ b/endpoints/logout.post.py @@ -1,17 +1,15 @@ # Entity: User from fastapi import APIRouter, Depends, status -from sqlalchemy.orm import Session -from core.database import get_db +from fastapi.security import OAuth2PasswordBearer from models.user import User from schemas.user import UserSchema -from helpers.user_helpers import logout_user router = APIRouter() +oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") -@router.post("/logout", status_code=200) -async def logout( - db: Session = Depends(get_db) -): - logout_user(db) - return {"message": "Logged out successfully"} \ No newline at end of file +@router.post("/logout", status_code=status.HTTP_200_OK) +async def logout(token: str = Depends(oauth2_scheme)): + # Implement logout logic here + # For example, invalidate the token or remove it from the cache + return {"message": "Logout successful"} \ No newline at end of file