Update code in endpoints/logout.post.py
This commit is contained in:
parent
b2705c092a
commit
f14ab3bd90
11
endpoints/logout.post.py
Normal file
11
endpoints/logout.post.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
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"}
|
Loading…
x
Reference in New Issue
Block a user