social-app-django icon indicating copy to clipboard operation
social-app-django copied to clipboard

How can I use this package with my custom user model?

Open ManuelBuri opened this issue 3 years ago • 1 comments

Hi, I am a bit lost! How can I use this package with my custom user model? Any examples/tutorials out there?

ManuelBuri avatar May 26 '21 15:05 ManuelBuri

Depends a bit on your custom user model.

If the custom user model does not have any new required fields (that do not have default value), you need to do nothing.

If there is such fields, you need to add function(s) to the auth pipeline that get the required data from auth if the data is not mapped already by https://github.com/python-social-auth/social-core/blob/master/social_core/pipeline/social_auth.py#L4 (assuming you have this in your SOCIAL_AUTH_PIPELINE)

By default the user object is created by https://github.com/python-social-auth/social-core/blob/master/social_core/pipeline/user.py#L68

The relevant documentation is in https://python-social-auth.readthedocs.io/en/latest/pipeline.html#authentication-pipeline

janneronkko avatar May 31 '21 06:05 janneronkko