diff --git a/app/routers/token.py b/app/routers/token.py index 02defe6..8b13860 100644 --- a/app/routers/token.py +++ b/app/routers/token.py @@ -34,4 +34,11 @@ async def login_for_access_token( async def check_token(current_user: Annotated[users.User, Depends(users_token.get_current_active_user)], authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))]): content = {"message": "Check token"} response = JSONResponse(content=content) + return response + +@router.delete("/token",tags=["token"]) +async def check_token(current_user: Annotated[users.User, Depends(users_token.get_current_active_user)], authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))]): + content = {"message": "Token deleted"} + response = JSONResponse(content=content) + response.set_cookie(key="access_token", value="", httponly=True) return response \ No newline at end of file