-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Merge improvements from anonymous auth PR (#309) #808
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
Merge improvements from anonymous auth PR (#309) #808
Conversation
Signed-off-by: Alex Saveau <[email protected]>
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.
@SUPERCILEX thanks for doing this! Excited about the Twitter improvements. Just a few questions.
Also we should target 2.1.1-dev
not master
.
if ((providerId.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID) | ||
|| providerId.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID) | ||
|| providerId.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID) | ||
|| providerId.equalsIgnoreCase(GithubAuthProvider.PROVIDER_ID)) |
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.
What's github doing here?
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.
Lol, must have been a merge mistake from a long time ago.
|
||
try { | ||
email = object.getString("email"); | ||
} catch (JSONException ignored) { } |
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.
Shouldn't we at least log a warning if we can't get email?
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.
Yup.
TwitterCore.getInstance() | ||
.getApiClient() | ||
.getAccountService() | ||
.verifyCredentials(false, false, 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.
Can you add a comment documenting the false, false, true
magic sequence?
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.
TBH, I just copied that from StackOverflow 😆. I did a bit of debugging and figured some of it out (in order): includeEntities
will populate the User#entities
field but we don't need it, skipStatus
I have no idea what that does, includeEmail
includes the email (duh! 😄).
Do you want me to document the parameter names? Intellij shows them, but it could be useful for GitHub:
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.
That's alright, thanks for clarifying!
} | ||
|
||
private IdpResponse( | ||
String providerId, | ||
String email, | ||
User user, | ||
String phoneNumber, |
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.
any reason why email was merged into User
but not phoneNumber?
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.
Good catch!
Signed-off-by: Alex Saveau <[email protected]>
@SUPERCILEX last thing left is to target the |
@samtstern Oops, I've updated the base now. |
@samtstern While working on automatically merging user profiles for #309, I made several improvements worth merging back into master:
IdpResponse
user data is unified and uses ourUser
object under the hood now