Skip to content

Commit

Permalink
Revert "Don't use resultCode when handling SignIn result"
Browse files Browse the repository at this point in the history
This reverts commit 0ccfa66.
  • Loading branch information
andreidiaconu authored Feb 17, 2019
1 parent c4a301e commit 383c6ce
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,12 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
}
return true;
case REQUEST_CODE_SIGNIN:
// Whether resultCode is OK or not, the Task returned by GoogleSigIn will determine
// failure with better specifics which are extracted in onSignInResult method.
if (data != null) {
if (resultCode == Activity.RESULT_OK && data != null) {
onSignInResult(GoogleSignIn.getSignedInAccountFromIntent(data));
} else if (resultCode == Activity.RESULT_CANCELED) {
finishWithError(ERROR_REASON_SIGN_IN_CANCELED, "User canceled sign in");
} else {
// data is null which is highly unusual for a sign in result.
finishWithError(ERROR_REASON_SIGN_IN_FAILED, "Signin failed");
finishWithError(ERROR_REASON_STATUS, "Sign in failed with " + resultCode);
}
return true;
default:
Expand Down

0 comments on commit 383c6ce

Please sign in to comment.