summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings/user_settings_security.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/user_settings/user_settings_security.jsx')
-rw-r--r--webapp/components/user_settings/user_settings_security.jsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx
index ec84f4cb5..976e65981 100644
--- a/webapp/components/user_settings/user_settings_security.jsx
+++ b/webapp/components/user_settings/user_settings_security.jsx
@@ -26,7 +26,7 @@ const holders = defineMessages({
},
passwordLengthError: {
id: 'user.settings.security.passwordLengthError',
- defaultMessage: 'New passwords must be at least {chars} characters'
+ defaultMessage: 'New passwords must be at least {min} characters and at most {max} characters.'
},
passwordMatchError: {
id: 'user.settings.security.passwordMatchError',
@@ -90,8 +90,12 @@ class SecurityTab extends React.Component {
return;
}
- if (newPassword.length < Constants.MIN_PASSWORD_LENGTH) {
- this.setState({passwordError: formatMessage(holders.passwordLengthError, {chars: Constants.MIN_PASSWORD_LENGTH}), serverError: ''});
+ const passwordErr = Utils.isValidPassword(newPassword);
+ if (passwordErr !== '') {
+ this.setState({
+ passwordError: passwordErr,
+ serverError: ''
+ });
return;
}