Skip to content

Commit aeec7dc

Browse files
committed
handle authState exceptions
1 parent edbf241 commit aeec7dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

auth/src/main/java/com/firebase/ui/auth/compose/configuration/auth_provider/EmailAuthProvider+FirebaseAuthUI.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ internal suspend fun FirebaseAuthUI.createOrLinkUserWithEmailAndPassword(
166166
if (canUpgrade && pendingCredential != null) {
167167
// Anonymous upgrade collision: emit merge conflict state
168168
updateAuthState(AuthState.MergeConflict(pendingCredential))
169+
} else {
170+
updateAuthState(AuthState.Error(authException))
169171
}
170172
throw authException
171173
} catch (e: CancellationException) {
@@ -465,6 +467,8 @@ internal suspend fun FirebaseAuthUI.signInAndLinkWithCredential(
465467
} else {
466468
updateAuthState(AuthState.Error(authException))
467469
}
470+
} else {
471+
updateAuthState(AuthState.Error(authException))
468472
}
469473
throw authException
470474
} catch (e: CancellationException) {

0 commit comments

Comments
 (0)