diff options
author | David Lu <david.lu97@outlook.com> | 2016-08-09 17:00:51 -0400 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-08-09 16:00:51 -0500 |
commit | e4b0680a795bfeda5575f2be3e4b6359dc01bd2d (patch) | |
tree | 4cdd20c2f6e316a43ca8cc4891982af0882fcd17 /webapp/components/admin_console | |
parent | 1e7e6687e334d055c88bf0dac56ac29c36efab51 (diff) | |
download | chat-e4b0680a795bfeda5575f2be3e4b6359dc01bd2d.tar.gz chat-e4b0680a795bfeda5575f2be3e4b6359dc01bd2d.tar.bz2 chat-e4b0680a795bfeda5575f2be3e4b6359dc01bd2d.zip |
Fixed reset password error (#3769)
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r-- | webapp/components/admin_console/reset_password_modal.jsx | 19 |
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( |