Skip to content

Commit b066fa3

Browse files
committed
FIX - Display error under the pin widget
1 parent 661c31e commit b066fa3

File tree

1 file changed

+11
-5
lines changed
  • packages/firebase_ui_auth/lib/src

1 file changed

+11
-5
lines changed

packages/firebase_ui_auth/lib/src/mfa.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ Future<fba.UserCredential?> startPhoneMFAVerification({
4848
final hint = resolver.hints.first;
4949
var completer = Completer<fba.UserCredential?>();
5050

51-
completer.future.catchError((e) {
52-
onError?.call(e as FirebaseException);
53-
return null;
54-
});
55-
5651
final navigator = Navigator.of(context);
5752

5853
final provider = PhoneAuthProvider();
@@ -66,12 +61,23 @@ Future<fba.UserCredential?> startPhoneMFAVerification({
6661

6762
provider.authListener = flow;
6863

64+
completer.future.catchError((e) {
65+
onError?.call(e as FirebaseException);
66+
flow.onError(e);
67+
return null;
68+
});
69+
6970
final flowKey = Object();
7071

7172
final actions = [
7273
AuthStateChangeAction<CredentialReceived>((context, inner) {
7374
if (completer.isCompleted) {
7475
completer = Completer<fba.UserCredential>();
76+
completer.future.catchError((e) {
77+
onError?.call(e as FirebaseException);
78+
flow.onError(e);
79+
return null;
80+
});
7581
}
7682

7783
final cred = inner.credential as fba.PhoneAuthCredential;

0 commit comments

Comments
 (0)