summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/reset_password_modal.jsx
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-08-09 17:05:59 -0500
committerElias Nahum <nahumhbl@gmail.com>2016-08-09 17:05:59 -0500
commit805659239098a0b382a2a8bad704c2e91ab38ed6 (patch)
treee2c42b89d7ffc830bd9270cc65780fe470ccb4f4 /webapp/components/admin_console/reset_password_modal.jsx
parent7be82c2b279390d3659fbe74c7d3ccabc48a6dd8 (diff)
parentac2f75ac8fd4e2d7ae1de6703a156b9636d4b8f0 (diff)
downloadchat-805659239098a0b382a2a8bad704c2e91ab38ed6.tar.gz
chat-805659239098a0b382a2a8bad704c2e91ab38ed6.tar.bz2
chat-805659239098a0b382a2a8bad704c2e91ab38ed6.zip
Merge branch 'release-3.3' RC3
Diffstat (limited to 'webapp/components/admin_console/reset_password_modal.jsx')
-rw-r--r--webapp/components/admin_console/reset_password_modal.jsx19
1 files changed, 6 insertions, 13 deletions
diff --git a/webapp/components/admin_console/reset_password_modal.jsx b/webapp/components/admin_console/reset_password_modal.jsx
index 6d5a03f2a..dee04b87c 100644
--- a/webapp/components/admin_console/reset_password_modal.jsx
+++ b/webapp/components/admin_console/reset_password_modal.jsx
@@ -3,17 +3,10 @@
import ReactDOM from 'react-dom';
import Client from 'client/web_client.jsx';
-import Constants from 'utils/constants.jsx';
+import * as Utils from 'utils/utils.jsx';
import {Modal} from 'react-bootstrap';
-import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
-
-var holders = defineMessages({
- submit: {
- id: 'admin.reset_password.submit',
- defaultMessage: 'Please enter at least {chars} characters.'
- }
-});
+import {injectIntl, intlShape, FormattedMessage} from 'react-intl';
import React from 'react';
@@ -31,13 +24,13 @@ class ResetPasswordModal extends React.Component {
doSubmit(e) {
e.preventDefault();
- var password = ReactDOM.findDOMNode(this.refs.password).value;
+ const password = this.refs.password.value;
- if (!password || password.length < Constants.MIN_PASSWORD_LENGTH) {
- this.setState({serverError: this.props.intl.formatMessage(holders.submit, {chars: Constants.MIN_PASSWORD_LENGTH})});
+ const passwordErr = Utils.isValidPassword(password);
+ if (passwordErr) {
+ this.setState({serverError: passwordErr});
return;
}
-
this.setState({serverError: null});
Client.adminResetPassword(