diff --git a/packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java b/packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java index ad0570e254..4c9beb9d78 100644 --- a/packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java +++ b/packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java @@ -1314,13 +1314,18 @@ private void linkWithCredential( if (exception instanceof FirebaseAuthUserCollisionException) { FirebaseAuthUserCollisionException authUserCollisionException = (FirebaseAuthUserCollisionException) exception; AuthCredential updatedCredential = authUserCollisionException.getUpdatedCredential(); - firebaseAuth.signInWithCredential(updatedCredential).addOnCompleteListener(getExecutor(), result -> { - if (result.isSuccessful()) { - promiseWithAuthResult(result.getResult(), promise); - } else { - promiseRejectAuthException(promise, exception); - } - }); + 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); }