Skip to content

Commit

Permalink
Update auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Feb 7, 2025
1 parent c72c59e commit 8291a25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/authx/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8291a25

Please sign in to comment.