Update code in endpoints/api/v1/endpoint.post.py
This commit is contained in:
parent
3982079815
commit
1a7cbafd25
22
endpoints/api/v1/endpoint.post.py
Normal file
22
endpoints/api/v1/endpoint.post.py
Normal file
@ -0,0 +1,22 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from core.database import fake_users_db
|
||||
from core.auth import get_current_user_dummy
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/logout")
|
||||
async def logout_demo(
|
||||
token: str = Depends(get_current_user_dummy)
|
||||
):
|
||||
"""Demo logout endpoint"""
|
||||
if not token:
|
||||
raise HTTPException(status_code=400, detail="No active session found")
|
||||
|
||||
return {
|
||||
"message": "Logout successful",
|
||||
"session_status": "terminated",
|
||||
"metadata": {
|
||||
"logout_time": "demo_timestamp",
|
||||
"session_duration": "demo_duration"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user