Skip to content

Commit

Permalink
Resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsibilla committed Sep 1, 2023
2 parents d24f145 + 29c4746 commit 403e54d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/routes/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Blueprint, redirect, request, session, current_app, make_response
from flask import Blueprint, redirect, request, session, current_app, Response, make_response
from globus_sdk import AccessTokenAuthorizer, AuthClient, ConfidentialAppAuthClient
import json
import logging
Expand Down Expand Up @@ -76,12 +76,20 @@ def _login(redirect_uri, key = 'tokens'):
# Also get the user info (sub, email, name, preferred_username) using the AuthClient with the auth token
user_info = get_user_info(auth_token)

# Check if user has read permissions
auth_helper_instance: AuthHelper = AuthHelper.instance()
read_privs = auth_helper_instance.has_read_privs(groups_token)
if isinstance(read_privs, Response):
return read_privs


info = {
'name': user_info['name'],
'email': user_info['email'],
'globus_id': user_info['sub'],
'auth_token': auth_token,
'transfer_token': transfer_token,
'read_privs': read_privs,
'groups_token': groups_token
}

Expand Down

0 comments on commit 403e54d

Please sign in to comment.