Hi,
I am trying the following code,
@strategy()
def register_by_access_token(request, backend):
backend = request.strategy.backend
try:
user = request.user
user = backend._do_auth(
access_token = request.GET.get('access_token'),
user = user.is_authenticated() and user or None
)
except Exception as err:
print "User is None", err
if user and user.is_active:
return user
else:
return None
However, when I try to include strategy by writing down "from social.apps.django_app.utils import strategy", I get "cannot import name strategy" error. After looking into the souce code of social/apps/django_app/utils.py, I could not find "strategy". Am I using a wrong version or where did I do wrong?
Hi,
I am trying the following code,
@strategy()
def register_by_access_token(request, backend):
backend = request.strategy.backend
try:
user = request.user
user = backend._do_auth(
access_token = request.GET.get('access_token'),
user = user.is_authenticated() and user or None
)
except Exception as err:
print "User is None", err
if user and user.is_active:
return user
else:
return None
However, when I try to include strategy by writing down "from social.apps.django_app.utils import strategy", I get "cannot import name strategy" error. After looking into the souce code of social/apps/django_app/utils.py, I could not find "strategy". Am I using a wrong version or where did I do wrong?