Skip to content

Commit 848e1ff

Browse files
committed
Merge branch 'clintonb-oauth2-token-type'
2 parents 3a2e40c + 957578e commit 848e1ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

social/backends/oauth.py

+10
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ def auth_headers(self):
357357
return {'Content-Type': 'application/x-www-form-urlencoded',
358358
'Accept': 'application/json'}
359359

360+
def extra_data(self, user, uid, response, details=None, *args, **kwargs):
361+
"""Return access_token, token_type, and extra defined names to store in
362+
extra_data field"""
363+
data = super(BaseOAuth2, self).extra_data(user, uid, response,
364+
details=details,
365+
*args, **kwargs)
366+
data['token_type'] = response.get('token_type') or \
367+
kwargs.get('token_type')
368+
return data
369+
360370
def request_access_token(self, *args, **kwargs):
361371
return self.get_json(*args, **kwargs)
362372

0 commit comments

Comments
 (0)