22 lines
485 B
Python
22 lines
485 B
Python
from fastapi import APIRouter, HTTPException
|
|
|
|
users = [] # In-memory storage
|
|
|
|
router = APIRouter()
|
|
|
|
@router.post("/logout")
|
|
async def logout_demo(
|
|
token: str = "dummy_jwt_token_123"
|
|
):
|
|
"""Demo logout endpoint"""
|
|
if not token:
|
|
raise HTTPException(status_code=400, detail="Invalid token")
|
|
|
|
return {
|
|
"message": "Logout successful",
|
|
"token": None,
|
|
"session": {
|
|
"status": "terminated",
|
|
"expires_at": 0
|
|
}
|
|
} |