Skip to content

Commit

Permalink
check if user is already authz
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Jan 25, 2025
1 parent e73d626 commit 80e546f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/authx/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@ def add_pending_user_to_opa(user_token):
if user_name is None:
return {"error": "Could not verify jwt or obtain user ID"}, 403

user, status_code = get_user_in_opa(user_name)
if status_code != 404:
return {"message": f"User {user_name} is already a CanDIG authoried user"}, 200
user_dict = {
"userinfo": {
"user_name": user_name,
Expand Down

0 comments on commit 80e546f

Please sign in to comment.