Remove existence & length checks on passwords & phrases (#3854)

* Allow input to receive FormattedMessage errors

* Only do existence checks on phrases & passwords

* Add missing import

* Remove existence checks, display security reminder
This commit is contained in:
Jaco Greeff
2016-12-19 13:17:28 +01:00
committed by GitHub
parent 7185fb0f37
commit 1b59ceb7c1
13 changed files with 268 additions and 165 deletions

View File

@@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import ActionDone from 'material-ui/svg-icons/action/done';
import ActionDoneAll from 'material-ui/svg-icons/action/done-all';
import ContentClear from 'material-ui/svg-icons/content/clear';
@@ -22,7 +23,7 @@ import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back';
import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
import PrintIcon from 'material-ui/svg-icons/action/print';
import { Button, Modal } from '~/ui';
import { Button, Modal, Warning } from '~/ui';
import AccountDetails from './AccountDetails';
import AccountDetailsGeth from './AccountDetailsGeth';
@@ -86,6 +87,7 @@ export default class CreateAccount extends Component {
actions={ this.renderDialogActions() }
current={ stage }
steps={ steps }>
{ this.renderWarning() }
{ this.renderPage() }
</Modal>
);
@@ -200,6 +202,22 @@ export default class CreateAccount extends Component {
}
}
renderWarning () {
const { createType, stage } = this.state;
if (stage !== 1 || ['fromJSON', 'fromPresale'].includes(createType)) {
return null;
}
return (
<Warning warning={
<FormattedMessage
id='createAccount.warning.insecurePassword'
defaultMessage='It is recommended that a strong password be used to secure your accounts. Empty and trivial passwords are a security risk.' />
} />
);
}
onNext = () => {
this.setState({
stage: this.state.stage + 1