Update code in endpoints/api/v1/endpoint.post.py
This commit is contained in:
parent
1979172138
commit
1071e3bb05
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(
|
||||
current_user: dict = Depends(get_current_user_dummy)
|
||||
):
|
||||
"""Demo logout endpoint"""
|
||||
if not current_user:
|
||||
raise HTTPException(status_code=401, detail="Not authenticated")
|
||||
|
||||
return {
|
||||
"message": "Logout successful",
|
||||
"username": current_user.get("username"),
|
||||
"metadata": {
|
||||
"session_ended": True,
|
||||
"timestamp": "demo_timestamp"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user