Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_ui_auth] - exception is only throw one time when using startMFAVerification #481

Open
1 task done
wer-mathurin opened this issue Mar 14, 2025 · 2 comments
Open
1 task done

Comments

@wer-mathurin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and found no duplicates.

What plugin is this bug for?

Firebase UI Auth

What platform(s) does this bug affect?

Web

List of dependencies used.

flutter pub deps -s list
  

Steps to reproduce

if you have this in your actions:

AuthStateChangeAction<MFARequired>((context, state) async {
     try {
        await startMFAVerification(
          resolver: state.resolver,
          context: context,
        );
      } on FirebaseException catch (e) {
        if (!context.mounted) return;
        ScaffoldMessenger.of(context).hideCurrentSnackBar();
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(
            content: ErrorText(exception: e),
          ),
        );
      }
}),

The Exception only only catch the first time as you can see it:

Image

If you press a second time on the validation button

Image

The Exception is not raised to the previous catch statement....but print to the console

Image

Expected Behavior

The the error as many time needed.

One you have an error, In was expecting form this helper method to restart:

  provider.sendVerificationCode(
      hint: hint as fba.PhoneMultiFactorInfo,
      multiFactorSession: session,
      action: AuthAction.none,
    );

Otherwise once you have an error, you need to go to the previous page and type correctly the pin.
I'm expecting user to sometime do mistakes when entering the code, so this can be very annoying from an end user perspective.

Actual Behavior

Only trigger one time

Additional Information

No response

@wer-mathurin
Copy link
Author

I provided a PR #482 for this.

@wer-mathurin
Copy link
Author

Additional information.

@russellwheatley

The problem came from the way the implementation is done, the code validation can only be executed once otherwise you will get an exception that the Completer is already done !!!

The provided #482 resolved that, but not in a clean way :-(

We did it in our codebase a more clean way. I can update the PR accordingly, but need to know if someone will look at it or do something about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant