firebase / firebase/FirebaseUI-Flutter

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

Ouverte
#481 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Keep Open Needs Attention
Langage dominant
Dart
Étoiles
151
Forks
141
Merge moyen
2 j 11 h
PR mergées (30 j)
6

Description

### Is there an existing issue for this?

- [x] 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((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](https://github.com/user-attachments/assets/411b8495-771d-4cf2-9eb8-39bdf7aa74c8)

If you press a second time on the validation button

![Image](https://github.com/user-attachments/assets/ae5972e4-22d2-4e03-b645-7238e2cde05a)

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

![Image](https://github.com/user-attachments/assets/7db91e6a-43de-4a4f-8cd0-da3f89186576)

### 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_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’implémentation de startMFAVerification dans firebase_ui_auth et comparez la façon dont elle gère l’appel montré à provider.sendVerificationCode après un code invalide. Reproduisez le flux avec AuthStateChangeAction et vérifiez que les erreurs de validation répétées atteignent le catch FirebaseException environnant, et pas seulement la première tentative.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
dart, firebase, flutter
Domaine
authentication, web-dev
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.