-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Always fetch emails when QUERY_EMAILS is set #4037
fix: Always fetch emails when QUERY_EMAILS is set #4037
Conversation
Changes unknown |
Note that in your scenario allauth (correctly) starts a new registration because email authentication cannot be used. The provider did provide an email, but as that email is not marked as verified, that email cannot be trusted. |
The code makes it impossible. The |
9d662cb
to
aef1128
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though it breaks the build on typing related constructs. Can you look into these? Thanks.
aef1128
to
5e8feba
Compare
5e8feba
to
10b6ee8
Compare
I encountered this situation by having the following context.
First, I have this social account configuration:
Next, I took these steps:
foo@bar.com
.github_login
view to initiate the process of linking my GitHub user w/ email addressfoo@bar.com
to my local user account.I inspected the data I was getting back from GH, and because the fetched profile had an
"email"
key in it, theself.get_emails()
call is never made. Since I don't have a provider setting on the"github"
provider configuration above, allauth seems to begin new user registration process instead of e.g. querying the DB for the given email address to see if it exists yet or not.This PR should be completely backwards compatible w/ current behavior, but in some cases it will result in an extra API call to fetch the user's email addresses. I will leave a comment w/ an alternative option in the diff.
Related to #3745.