cake-9s2bvx/endpoints/logout.post.py
2025-03-28 11:44:51 -05:00

11 lines
376 B
Python

from fastapi import APIRouter, Depends, HTTPException, status
from core.security import logout_user
from core.auth import get_current_active_user
router = APIRouter()
@router.post("/logout", status_code=200)
async def logout(current_user=Depends(get_current_active_user)):
"""Logout user"""
logout_user(current_user)
return {"message": "Logged out successfully"}