You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not using the default web flow but calling the do_auth from my custom method:
user=backend.do_auth(access_token, ajax=True)
The problem is that GithubOAuth2 backend never stores the access_token in the extra_data field.
I came up extending the GithubOauth2 backend:
classGithubOAuth2Extented(GithubOAuth2):
"""docstring for GithubOAuth2Extented"""# overriding parent method because it did not saved the access_tokendefuser_data(self, access_token, *args, **kwargs):
"""Loads user data from service"""data=self._user_data(access_token)
ifnotdata.get('email'):
try:
email=self._user_data(access_token, '/emails')[0]
except (HTTPError, IndexError, ValueError, TypeError):
email=''ifisinstance(email, dict):
email=email.get('email', '')
data['email'] =email# Added by medata['access_token'] =access_tokenreturndatasuper(GithubOAuth2Extented, self).user_data()
Not sure if it is the best solution tough
The text was updated successfully, but these errors were encountered:
I'm not using the default web flow but calling the
do_auth
from my custom method:The problem is that
GithubOAuth2
backend never stores theaccess_token
in theextra_data
field.I came up extending the
GithubOauth2
backend:Not sure if it is the best solution tough
The text was updated successfully, but these errors were encountered: