11 lines
388 B
Python
11 lines
388 B
Python
from fastapi import APIRouter, Depends, status
|
|
from fastapi.security import OAuth2PasswordBearer
|
|
from helpers.auth_helpers import logout_user
|
|
|
|
router = APIRouter()
|
|
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token")
|
|
|
|
@router.get("/logout", status_code=200)
|
|
async def logout(token: str = Depends(oauth2_scheme)):
|
|
logout_user(token)
|
|
return {"message": "Logged out successfully"} |