Skip to content

Commit

Permalink
fix!: improve error handling for finalizeMultiFactorEnrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
mnahkies committed Jan 14, 2024
1 parent 57ed042 commit 95dd587
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1241,12 +1241,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 95dd587

Please sign in to comment.