Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#481 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
dart, firebase, flutter

调研方向

从 firebase_ui_auth 中 startMFAVerification 的实现入手,比较其在代码无效后对所示 provider.sendVerificationCode 调用的处理方式。使用 AuthStateChangeAction 重现该流程,并验证重复的验证错误会到达外围的 FirebaseException catch,而不只是第一次尝试。

由索引模型根据 Issue 内容生成。

描述

Keep Open Needs Attention
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

主要语言
Dart
星标
152
派生
141
平均合并
2 天 12 小时
30 天内合并 PR
9

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/FirebaseUI-Flutter 的其他 Issue

查看 firebase/FirebaseUI-Flutter 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。