Skip to content

Commit

Permalink
Merge 56a9c41 into fbcd322
Browse files Browse the repository at this point in the history
  • Loading branch information
Albocal authored Sep 4, 2021
2 parents fbcd322 + 56a9c41 commit d045936
Showing 1 changed file with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1214,30 +1214,7 @@ private void linkWithCredential(
} else {
Exception exception = task.getException();
Log.e(TAG, "link:onComplete:failure", exception);
if (exception instanceof FirebaseAuthUserCollisionException) {
FirebaseAuthUserCollisionException authUserCollisionException =
(FirebaseAuthUserCollisionException) exception;
AuthCredential updatedCredential =
authUserCollisionException.getUpdatedCredential();
try {
firebaseAuth
.signInWithCredential(updatedCredential)
.addOnCompleteListener(
getExecutor(),
result -> {
if (result.isSuccessful()) {
promiseWithAuthResult(result.getResult(), promise);
} else {
promiseRejectAuthException(promise, exception);
}
});
} catch (Exception e) {
// we the attempt to log in after the collision failed, reject back to JS
promiseRejectAuthException(promise, exception);
}
} else {
promiseRejectAuthException(promise, exception);
}
promiseRejectAuthException(promise, exception);
}
});
} else {
Expand Down

0 comments on commit d045936

Please sign in to comment.