Skip to content

Commit

Permalink
fix(auth, android)!: correct error messages for finalizeMultiFactorEn…
Browse files Browse the repository at this point in the history
…rollment

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
  • Loading branch information
mnahkies authored and mikehardy committed Feb 26, 2024
1 parent e4db9bb commit b0be508
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1243,12 +1243,14 @@ public void finalizeMultiFactorEnrollment(
.enroll(assertion, displayName)
.addOnCompleteListener(
task -> {
if (!task.isSuccessful()) {
rejectPromiseWithExceptionMap(promise, task.getException());
if (task.isSuccessful()) {
Log.d(TAG, "finalizeMultiFactorEnrollment:onComplete:success");
promise.resolve(null);
} else {
Exception exception = task.getException();
Log.e(TAG, "finalizeMultiFactorEnrollment:onComplete:failure", exception);
promiseRejectAuthException(promise, exception);
}

// Need to reload user to make it all visible?
promise.resolve("yes");
});
}

Expand Down

0 comments on commit b0be508

Please sign in to comment.