问题
I use Firebase Authentication in my flutter app. I use PIN instead of normal password which is I strictly defined 6-digit number. In the case my user forgot their PIN, my only option (or not?) is by calling the sendPasswordResetEmail
method.
await firebaseAuth.sendPasswordResetEmail(email: userEmail);
The problem is they can type any new password in the Firebase reset password input and breaking the rule for 6-digit numeric only. Is there any way to customize the validation, caption text, etc?
UPDATE:
Just for clarification, the reset password form is provided by Firebase. It is impossible that users set their new password via my app to validate. They clicked the recovery link in their email, thus redirected to the Firebase website to set their new password. So the picture in my screenshot above is Firebase website, not even my flutter app, thus that's not even a TextFormField
. This is different question from the "duplicate."
回答1:
There is currently no way to set your own password requirements for Firebase Authentication's built-in email+password provider. If you want to control the password requirements, you'll have to build your own auth provider.
来源:https://stackoverflow.com/questions/60013011/customize-validation-text-in-firebase-reset-password-form