diff --git a/endpoints/logout.get.py b/endpoints/logout.get.py new file mode 100644 index 0000000..5e1a31e --- /dev/null +++ b/endpoints/logout.get.py @@ -0,0 +1,20 @@ +# Entity: Auth + +```python +from fastapi import APIRouter, Depends, Response +from core.database import get_db +from sqlalchemy.orm import Session +from helpers.auth_helpers import logout_user +from schemas.auth import LogoutResponse + +router = APIRouter() + +@router.get("/logout", status_code=200, response_model=LogoutResponse) +async def logout( + response: Response, + db: Session = Depends(get_db) +): + """Logout user by clearing auth cookies""" + logout_user(response) + return {"message": "Successfully logged out"} +``` \ No newline at end of file