Search code examples
djangopython-2.7python-social-auth

Multiple pipelines in python social auth


I am using python social auth to log users into my django-created website with their facebook/twitter/google + accounts. I would like to have 2 different pipelines for my login and registration buttons. Is that possible?

thanks.


Solution

  • While it is not possible to have 2 different pipelines, you can certainly make use of the capabilities to extend the pipeline to consider both the "log in" and "registration" scenarios.

    After the default pipeline function social.pipeline.social_auth.social_user, all subsequent functions have access to the is_new parameter, which is False if the user was already in the database (login scenario) or True if it must be created (register scenario). You can use this parameter to customize the logic in your own pipeline functions.

    Relevant information here: