Search code examples
pythondjangofacebookemailpython-social-auth

Python Social Auth User without email


There is one problem. I need users` emails to register a new one in my application. In other words, email is required for users. But there are Facebook accounts that do not have an email attached. So, in a result, we get an error.

I see one solution: when we recognized that Facebook returned us data without Facebook, show a form where a user should enter his email, he wants to use in the application. And then we can continue register process. But how to realize this? Actually, I have no idea.

What about you?

Thanks


Solution

  • Python social auth partial pipelines is the feature for that, their purpose is to interact with the user to fetch extra data needed for the authentication, for instance requiring emails, confirming the email address, etc.

    Check the example application at https://github.com/python-social-auth/social-examples/blob/master/example-django/example/settings.py#L216, it implements a partial pipeline that requests user email if it's missing from the authentication data.