We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2039c2b commit 2d96110Copy full SHA for 2d96110
common/services/auth0management.py
@@ -30,10 +30,15 @@ def get_roles_for_user(self, user_id):
30
{"Authorization": "Bearer " + self.access_token}}
31
resp = requests.get(url, headers=heads)
32
data = resp.json()
33
- if (data.get("statusCode") == 401 and "xpired token" in data.get("message")):
+ if isinstance(data, list):
34
+ return data
35
+ elif (data.get("statusCode") == 401 and "xpired token" in data.get("message")):
36
self.access_token = self.get_token()
37
return self.get_roles_for_user(user_id)
- return data
38
+ else:
39
+ logging.error("encountered unexpected auth0 management API response")
40
+ logging.error(data)
41
+ return []
42
43
44
def get_token(self):
0 commit comments