diff --git a/endpoints/logouts.post.py b/endpoints/logouts.post.py new file mode 100644 index 0000000..c55066f --- /dev/null +++ b/endpoints/logouts.post.py @@ -0,0 +1,19 @@ +# Entity: Auth + +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 +from core.security import get_current_user + +router = APIRouter() + +@router.post("/logouts", status_code=200) +async def logout( + current_user: Auth = Depends(get_current_user), + db: Session = Depends(get_db) +): + logout_user(db, current_user) + return {"message": "Successfully logged out"} \ No newline at end of file