Bläddra i källkod

Merge pull request #320 from ente-io/create_account_validation

Fix password match during sign up
Manav 3 år sedan
förälder
incheckning
6e21a02437
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      lib/ui/email_entry_page.dart

+ 4 - 1
lib/ui/email_entry_page.dart

@@ -34,6 +34,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
 
   String _email;
   String _password;
+  String _cnfPassword = '';
   double _passwordStrength = 0.0;
   bool _emailIsValid = false;
   bool _hasAgreedToTOS = true;
@@ -238,6 +239,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                               estimatePasswordStrength(password);
                           _passwordIsValid = _passwordStrength >=
                               kMildPasswordStrengthThreshold;
+                          _passwordsMatch = _password == _cnfPassword;
                         });
                       }
                     },
@@ -296,8 +298,9 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                     focusNode: _password2FocusNode,
                     onChanged: (cnfPassword) {
                       setState(() {
+                        _cnfPassword = cnfPassword;
                         if (_password != null || _password != '') {
-                          _passwordsMatch = _password == cnfPassword;
+                          _passwordsMatch = _password == _cnfPassword;
                         }
                       });
                     },