Skip to content

Commit b0be508

Browse files
mnahkiesmikehardy
authored andcommitted
fix(auth, android)!: correct error messages for finalizeMultiFactorEnrollment
BREAKING CHANGE: multifactor error messages were auth/unknown before on android Now they will correctly come through as auth/invalid-verification-code If you were relying on the previous auth/unknown codes you will need to update your error handling code
1 parent e4db9bb commit b0be508

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/auth/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,12 +1243,14 @@ public void finalizeMultiFactorEnrollment(
12431243
.enroll(assertion, displayName)
12441244
.addOnCompleteListener(
12451245
task -> {
1246-
if (!task.isSuccessful()) {
1247-
rejectPromiseWithExceptionMap(promise, task.getException());
1246+
if (task.isSuccessful()) {
1247+
Log.d(TAG, "finalizeMultiFactorEnrollment:onComplete:success");
1248+
promise.resolve(null);
1249+
} else {
1250+
Exception exception = task.getException();
1251+
Log.e(TAG, "finalizeMultiFactorEnrollment:onComplete:failure", exception);
1252+
promiseRejectAuthException(promise, exception);
12481253
}
1249-
1250-
// Need to reload user to make it all visible?
1251-
promise.resolve("yes");
12521254
});
12531255
}
12541256

0 commit comments

Comments
 (0)