Search code examples
djangoauthenticationpython-social-auth

Python Social Auth - Ask user to type email if on facebook login


If facebook account have an email addres it's working fine and saving user with correct email address.

I want to ask users while login with facebook to type their email address if the Facebook account is made with phone number. The users should type an email address in a form and then save the user account.

How can I do that?


Solution

  • Take a look to partial pipelines feature, it's main purpose is to pause the auth process and continue later, in this scenario you send your users lacking email to the corresponding form, once they submit the values, you continue the pipeline and finish the auth process.

    Documentation at: https://python-social-auth.readthedocs.io/en/latest/pipeline.html#partial-pipeline

    Example: https://github.com/python-social-auth/social-examples/blob/master/example-django/example/settings.py#L218