-
Notifications
You must be signed in to change notification settings - Fork 229
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
Load user email in LinkedIn provider #191
Conversation
Do we have enough specs to test this case? |
@chhga unfortunately we don't have reliable specs for any of the OAuth providers. I don't know that it's worth the dev-time to develop it however, as the plan is to switch to Omniauth at some point. That being said, I wouldn't be opposed if someone wanted to put the time into creating specs. We can definitely use more coverage. |
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.
I realized that this doesn't conditionally check for the r_emailaddress
scope, and will always hit the email url. This could have unintended consequences for apps that only use r_liteprofile
.
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.
I'm tempted to change the comment inside the initializer, but the code itself looks good to go.
I'll add the changelog and tweak the wording a little bit in the initializer before merging.
Thank you @JakubSzajna for your work on this! Merging. |
As per https://github.com/Sorcery/sorcery/blob/master/lib/generators/sorcery/templates/migration/core.rb user email is a mandatory field in the DB. Thus, the recent fix for LinkedIn provider will produce an error when you try to register a new profile with it.
This fix loads user email from the additional endpoint in LinkedIn API v2 following this description: https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin?context=linkedin/consumer/context#retrieving-member-email-address