After I create a user using say Facebook(let\'s say fbuser) or Google(googleuser). If I create another user through the normal django admin(normaluser), and try logging aga
My approach to this problem was a little different, instead of tackling this in the pipeline, I made sure that a user was never passed into the pipeline in the first place. This way, even if the social_auth.user does not match the logged in user, the social_auth.user will be logged in on top of the currently logged in user.
I think it's as easy as overriding the complete action.
urls.py
url(r'^complete/(?P[^/]+)/$', 'account.views.complete', name='complete'),
account/views.py
from social.actions import do_complete
from social.apps.django_app.utils import strategy
from social.apps.django_app.views import _do_login
@csrf_exempt
@strategy('social:complete')
def complete(request, backend, *args, **kwargs):
"""Override this method so we can force user to be logged out."""
return do_complete(request.social_strategy, _do_login, user=None,
redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)