Skip to content

Commit 5fa806d

Browse files
plxitycatarak
authored andcommitted
Password limit (#1191)
* changes * changes * changes * changes * changes * changez
1 parent dd2094f commit 5fa806d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

client/utils/reduxFormUtils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export function validateSettings(formProps) {
4444
if (formProps.currentPassword && !formProps.newPassword) {
4545
errors.newPassword = 'Please enter a new password or leave the current password empty.';
4646
}
47-
47+
if (formProps.newPassword && formProps.newPassword.length < 6) {
48+
errors.newPassword = 'Password must be at least 6 characters';
49+
}
4850
return errors;
4951
}
5052

@@ -67,10 +69,8 @@ export function validateSignup(formProps) {
6769
if (!formProps.password) {
6870
errors.password = 'Please enter a password';
6971
}
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';
7474
}
7575
if (!formProps.confirmPassword) {
7676
errors.confirmPassword = 'Please enter a password confirmation';

0 commit comments

Comments
 (0)