浏览代码

Merge pull request #320 from ente-io/create_account_validation

Fix password match during sign up
Manav 3 年之前
父节点
当前提交
6e21a02437
共有 1 个文件被更改,包括 4 次插入1 次删除
  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 _email;
   String _password;
   String _password;
+  String _cnfPassword = '';
   double _passwordStrength = 0.0;
   double _passwordStrength = 0.0;
   bool _emailIsValid = false;
   bool _emailIsValid = false;
   bool _hasAgreedToTOS = true;
   bool _hasAgreedToTOS = true;
@@ -238,6 +239,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                               estimatePasswordStrength(password);
                               estimatePasswordStrength(password);
                           _passwordIsValid = _passwordStrength >=
                           _passwordIsValid = _passwordStrength >=
                               kMildPasswordStrengthThreshold;
                               kMildPasswordStrengthThreshold;
+                          _passwordsMatch = _password == _cnfPassword;
                         });
                         });
                       }
                       }
                     },
                     },
@@ -296,8 +298,9 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                     focusNode: _password2FocusNode,
                     focusNode: _password2FocusNode,
                     onChanged: (cnfPassword) {
                     onChanged: (cnfPassword) {
                       setState(() {
                       setState(() {
+                        _cnfPassword = cnfPassword;
                         if (_password != null || _password != '') {
                         if (_password != null || _password != '') {
-                          _passwordsMatch = _password == cnfPassword;
+                          _passwordsMatch = _password == _cnfPassword;
                         }
                         }
                       });
                       });
                     },
                     },