Update code in endpoints/logout.post.py
This commit is contained in:
parent
9e4197396f
commit
36ebb66e9c
@ -1,17 +1,11 @@
|
|||||||
# Entity: User
|
# Entity: User
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, status
|
from fastapi import APIRouter, Depends, status
|
||||||
from sqlalchemy.orm import Session
|
from core.auth import logout_user
|
||||||
from core.database import get_db
|
from schemas.user import UserLogoutSchema
|
||||||
from models.user import User
|
|
||||||
from schemas.user import UserSchema
|
|
||||||
from helpers.user_helpers import logout_user
|
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/logout", status_code=200)
|
@router.post("/logout", status_code=200, response_model=UserLogoutSchema)
|
||||||
async def logout(
|
async def logout(user=Depends(logout_user)):
|
||||||
db: Session = Depends(get_db)
|
|
||||||
):
|
|
||||||
logout_user(db)
|
|
||||||
return {"message": "Logged out successfully"}
|
return {"message": "Logged out successfully"}
|
Loading…
x
Reference in New Issue
Block a user