Skip to content

Commit 299532d

Browse files
Alex Swehlaposita
authored andcommitted
modifying oauth2 flow to check for the team_id key and populate the resulting object accordingly
1 parent ff047eb commit 299532d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

dropbox/oauth.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,19 @@ def _finish(self, code, redirect_uri):
120120
resp.raise_for_status()
121121

122122
d = resp.json()
123+
124+
access_token = d['access_token']
125+
uid = d['uid']
126+
if 'team_id' in d:
127+
account_id = d['team_id']
128+
else:
129+
account_id = d['account_id']
130+
123131

124132
return OAuth2FlowNoRedirectResult(
125-
d['access_token'],
126-
d['account_id'],
127-
d['uid'])
133+
access_token,
134+
account_id,
135+
uid)
128136

129137
def build_path(self, target, params=None):
130138
"""Build the path component for an API URL.

0 commit comments

Comments
 (0)