i have added my custom pipeline
SOCIAL_AUTH_PIPELINE = (
'social_core.pipeline.social_auth.social_details',
'social_core.pipeline.social_auth.social_uid',
'social_core.pipeline.social_auth.auth_allowed',
'social_core.pipeline.social_auth.social_user',
'social_core.pipeline.user.get_username',
'social_core.pipeline.social_auth.associate_by_email',
'social_core.pipeline.user.create_user',
'social_core.pipeline.social_auth.associate_user',
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
'users.pipeline.return_token', <---- my custom pipeline//
)
pipeline.py
from django.http import JsonResponse, HttpResponse
def return_token(backend, user, response, *args, **kwargs):
if response is not None:
data = {"token": response['access_token'], "backend": "google-oauth2"}
return JsonResponse(data)
else:
return
when the user signup/login the user is registered to database and the access token is returned with no error
when i convert in http://localhost:8000/auth/convert-token
it returns error
AttributeError at /auth/convert-token
'JsonResponse' object has no attribute 'is_active'
when i disable my pipeline there is no error
how can i return access_token without getting error