fastapi-jwt-auth icon indicating copy to clipboard operation
fastapi-jwt-auth copied to clipboard

500 error if token invalid instead of 422

Open giuseppecalderaro opened this issue 4 years ago • 0 comments

I am seeing a 500 error when passing a wrong token instead of the usual 422. This happens with every version above 0.2.0.

Very basic example:

@auth_api_router_v1_0.get('/verify', status_code=status.HTTP_200_OK)
async def verify(authorize: AuthJWT = Depends()):
    authorize.jwt_required()
    return {'valid': True}

this is with a valid token, all good image

and this if token is expired: image

giuseppecalderaro avatar Jun 12 '21 17:06 giuseppecalderaro