pellersr-u2i23h/endpoints/logout.post.py
2025-03-28 10:47:33 +01:00

17 lines
444 B
Python

# Entity: User
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from core.database import get_db
from models.user import User
from schemas.user import UserSchema
from helpers.user_helpers import logout_user
router = APIRouter()
@router.post("/logout", status_code=200)
async def logout(
db: Session = Depends(get_db)
):
logout_user(db)
return {"message": "Logged out successfully"}