File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ export function validateSettings(formProps) {
44
44
if ( formProps . currentPassword && ! formProps . newPassword ) {
45
45
errors . newPassword = 'Please enter a new password or leave the current password empty.' ;
46
46
}
47
-
47
+ if ( formProps . newPassword && formProps . newPassword . length < 6 ) {
48
+ errors . newPassword = 'Password must be at least 6 characters' ;
49
+ }
48
50
return errors ;
49
51
}
50
52
@@ -67,10 +69,8 @@ export function validateSignup(formProps) {
67
69
if ( ! formProps . password ) {
68
70
errors . password = 'Please enter a password' ;
69
71
}
70
- if ( formProps . password ) {
71
- if ( formProps . password . length < 6 ) {
72
- errors . password = 'Password must be at least 6 characters' ;
73
- }
72
+ if ( formProps . password && formProps . password . length < 6 ) {
73
+ errors . password = 'Password must be at least 6 characters' ;
74
74
}
75
75
if ( ! formProps . confirmPassword ) {
76
76
errors . confirmPassword = 'Please enter a password confirmation' ;
You can’t perform that action at this time.
0 commit comments