diff --git a/lemur/auth/service.py b/lemur/auth/service.py index a92154971d..0c19b28d2b 100644 --- a/lemur/auth/service.py +++ b/lemur/auth/service.py @@ -117,6 +117,10 @@ def decorated_function(*args, **kwargs): return dict(message="Token has expired"), 403 except jwt.InvalidTokenError: return dict(message="Token is invalid"), 403 + except Exception: # noqa + if current_app.config.get("DEBUG", False): + raise + return dict(message="Failed to decode token"), 403 if "aid" in payload: access_key = api_key_service.get(payload["aid"])