-
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
adding 'include_email' parameter #83
base: master
Are you sure you want to change the base?
Conversation
@EvanBrightside |
@ebihara99999 yep, it will returns |
This PR would be greater if
What do you think @Ch4s3? |
@EvanBrightside The test will be like this expect do
User.create_from_provider('facebook', '123', username: 'Noam Ben Ari', email: nil)
end.to change { User.count }.by(1) See this PR, which fixes the inconsistency that required email and the lack of email by the twitter api specification. |
@EvanBrightside let us know if you're still working on this |
Gents @ebihara99999 @Ch4s3 I've added some specs! |
I’ll take a look tonight |
@Ch4s3 mate, what about this PR? ) |
User.create_from_provider('facebook', '123', username: 'Noam Ben Ari') | ||
end.to change { User.count }.by(1) | ||
it 'supports for facebook' do | ||
expect do |
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.
👍
@@ -15,7 +15,7 @@ def initialize | |||
super | |||
|
|||
@site = 'https://api.twitter.com' | |||
@user_info_path = '/1.1/account/verify_credentials.json' | |||
@user_info_path = '/1.1/account/verify_credentials.json?include_email=true' |
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.
Including the email is good, but iirc it requires additional permissions on the app config side. I'm worried that this could potentially break existing applications, and this should probably be a optional config in-of-itself. Unfortunately though, I don't have the time currently to investigate myself.
@ebihara99999 or @EvanBrightside, can you look into how this interacts with existing apps that don't have the email permission checked? If we can confirm that it doesn't break existing apps, and/or update this to be configurable from initializer.rb
, then I'd feel more comfortable merging. Thanks!
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.
Thank you for the review. As I said I think the parameter should be optional too because it returns nil, email is nil, if the app doesn’t have granted by Twitter. It breaks not-null constraint, which is imposed almost all cases.
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.
Would you change codes into configurable in initializer?
See this PR
https://github.com/Sorcery/sorcery/pull/109/files
And the initializer is lib/generators/sorcery/templates/initializer.rb
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.
If it’s somehow difficult or you don’t understand very well, mention to me. Just typing with a mobile, the explanation may be too short.
This will be implemented in v1, ideally with some tests for how to handle when permission does get denied. Ideally an app should be able to let the user know that it failed due to them not granting email permissions, then let them try again. |
With this parameter user can get
email address
from Twitter REST API, it will be returned in the user objects as a string. If the user does not have an email address on their account, or if the email address is not verified, null will be returned.