Update code in endpoints/logout.post.py
This commit is contained in:
parent
df409576ff
commit
0b893aea04
@ -1,6 +1,6 @@
|
|||||||
# Entity: User
|
# Entity: User
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, status
|
from fastapi import APIRouter, Depends, status
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from core.database import get_db
|
from core.database import get_db
|
||||||
from models.user import User
|
from models.user import User
|
||||||
@ -11,8 +11,7 @@ router = APIRouter()
|
|||||||
|
|
||||||
@router.post("/logout", status_code=200)
|
@router.post("/logout", status_code=200)
|
||||||
async def logout(
|
async def logout(
|
||||||
db: Session = Depends(get_db),
|
db: Session = Depends(get_db)
|
||||||
current_user: User = Depends(get_current_user)
|
|
||||||
):
|
):
|
||||||
logout_user(db, current_user)
|
logout_user(db)
|
||||||
return {"message": "Logged out successfully"}
|
return {"message": "Successfully logged out"}
|
Loading…
x
Reference in New Issue
Block a user