Skip to content

Social login existing if related user exists #3680

Answered by pennersr
pannkotsky asked this question in Q&A
Discussion options

You must be logged in to vote

Having a user instance attached is fine, but its pk should not be set / pointing to an existing user. The user instance originates from this piece of code:

https://github.com/pennersr/django-allauth/blob/main/allauth/socialaccount/providers/base/provider.py#L96

As you can see, a new_user() is instantiated there, which is not backed yet by a database record.

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pannkotsky
Comment options

You must be logged in to vote
1 reply
@pennersr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants