diff --git a/src/authx/auth.py b/src/authx/auth.py index f00b36d..1f5da3d 100644 --- a/src/authx/auth.py +++ b/src/authx/auth.py @@ -243,8 +243,10 @@ def is_action_allowed_for_program(token, method=None, path=None, program=None, o def is_user_candig_authorized(request, token=None): # if the user is in opa, they are CanDIG-authorized try: - response, status_code = get_self_in_opa(get_auth_token(request, token=token)) - except: + t = get_auth_token(request, token=token) + response, status_code = get_self_in_opa(t) + except Exception as e: + logger.debug(f"Token {t} raised exception {type(e)} {str(e)}") return False return status_code == 200