Update code in endpoints/logout.post.py

This commit is contained in:
Backend IM Bot 2025-03-28 00:34:36 +00:00
parent 2c1bb3fc6c
commit 1667d3e2bf

17
endpoints/logout.post.py Normal file
View File

@ -0,0 +1,17 @@
# Entity: Auth
from fastapi import APIRouter, Depends, HTTPException, status
from fastapi.security import OAuth2PasswordBearer
from sqlalchemy.orm import Session
from core.database import get_db
from helpers.auth_helpers import logout_user
router = APIRouter()
@router.post("/logout", status_code=200)
async def logout(
db: Session = Depends(get_db)
):
"""Logout user"""
logout_user(db)
return {"message": "Successfully logged out"}