Skip to content

Commit

Permalink
fix(linkedin): Use HTTP response code
Browse files Browse the repository at this point in the history
Similar to 8705514 but for LinkedIn
- If LinkedIn responds with  a 401 in case of an invalid token,
  raise an `HTTPError` (resp.raise_for_status) to handle the
  exception correctly instead of the current Http500 status
  because of a `KeyError`.
  • Loading branch information
priyadhoundiyal authored and pennersr committed Mar 5, 2018
1 parent 25fe632 commit 370d91f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions allauth/socialaccount/providers/linkedin_oauth2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def get_user_info(self, token):
fields = self.get_provider().get_profile_fields()
url = self.profile_url + ':(%s)?format=json' % ','.join(fields)
resp = requests.get(url, params={'oauth2_access_token': token.token})
resp.raise_for_status()
return resp.json()


Expand Down

0 comments on commit 370d91f

Please sign in to comment.