From 45b53b79f9b08f46807f61e67f24468b7019ff5f Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Fri, 6 Jan 2017 17:38:18 +0100 Subject: [PATCH 1/2] Passwords are valid by default #4059 --- js/src/modals/CreateAccount/NewAccount/newAccount.js | 2 +- js/src/modals/CreateAccount/NewImport/newImport.js | 2 +- js/src/modals/CreateAccount/RawKey/rawKey.js | 4 +--- .../CreateAccount/RecoveryPhrase/recoveryPhrase.js | 2 +- js/src/modals/CreateAccount/createAccount.js | 9 +++++++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/js/src/modals/CreateAccount/NewAccount/newAccount.js b/js/src/modals/CreateAccount/NewAccount/newAccount.js index c0bcca91a50..ed2c24612a6 100644 --- a/js/src/modals/CreateAccount/NewAccount/newAccount.js +++ b/js/src/modals/CreateAccount/NewAccount/newAccount.js @@ -40,7 +40,7 @@ export default class CreateAccount extends Component { accountNameError: ERRORS.noName, accounts: null, isValidName: false, - isValidPass: false, + isValidPass: true, passwordHint: '', password1: '', password1Error: null, diff --git a/js/src/modals/CreateAccount/NewImport/newImport.js b/js/src/modals/CreateAccount/NewImport/newImport.js index 17a1cfd447f..91ef39d9505 100644 --- a/js/src/modals/CreateAccount/NewImport/newImport.js +++ b/js/src/modals/CreateAccount/NewImport/newImport.js @@ -37,7 +37,7 @@ export default class NewImport extends Component { accountName: '', accountNameError: ERRORS.noName, isValidFile: false, - isValidPass: false, + isValidPass: true, isValidName: false, password: '', passwordError: null, diff --git a/js/src/modals/CreateAccount/RawKey/rawKey.js b/js/src/modals/CreateAccount/RawKey/rawKey.js index f284cf32308..d0b3a4c7118 100644 --- a/js/src/modals/CreateAccount/RawKey/rawKey.js +++ b/js/src/modals/CreateAccount/RawKey/rawKey.js @@ -36,7 +36,7 @@ export default class RawKey extends Component { accountNameError: ERRORS.noName, isValidKey: false, isValidName: false, - isValidPass: false, + isValidPass: true, passwordHint: '', password1: '', password1Error: null, @@ -119,8 +119,6 @@ export default class RawKey extends Component { const rawKey = event.target.value; let rawKeyError = null; - console.log(rawKey.length, rawKey); - if (!rawKey || !rawKey.trim().length) { rawKeyError = ERRORS.noKey; } else if (rawKey.substr(0, 2) !== '0x' || rawKey.substr(2).length !== 64 || !api.util.isHex(rawKey)) { diff --git a/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js b/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js index fd504302497..1d647fbb924 100644 --- a/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js +++ b/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js @@ -31,7 +31,7 @@ export default class RecoveryPhrase extends Component { state = { accountName: '', accountNameError: ERRORS.noName, - isValidPass: false, + isValidPass: true, isValidName: false, isValidPhrase: false, passwordHint: '', diff --git a/js/src/modals/CreateAccount/createAccount.js b/js/src/modals/CreateAccount/createAccount.js index 569d374ccd1..53be1f91839 100644 --- a/js/src/modals/CreateAccount/createAccount.js +++ b/js/src/modals/CreateAccount/createAccount.js @@ -240,6 +240,7 @@ export default class CreateAccount extends Component { if (createType === 'fromNew' || createType === 'fromPhrase') { let phrase = this.state.phrase; + if (createType === 'fromPhrase' && windowsPhrase) { phrase = phrase .split(' ') // get the words @@ -271,7 +272,9 @@ export default class CreateAccount extends Component { this.newError(error); }); - } else if (createType === 'fromRaw') { + } + + if (createType === 'fromRaw') { return api.parity .newAccountFromSecret(this.state.rawKey, this.state.password) .then((address) => { @@ -296,7 +299,9 @@ export default class CreateAccount extends Component { this.newError(error); }); - } else if (createType === 'fromGeth') { + } + + if (createType === 'fromGeth') { return api.parity .importGethAccounts(this.state.gethAddresses) .then((result) => { From 2838583f1b1e699503bee285428f340cc9ed835f Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Fri, 6 Jan 2017 17:46:33 +0100 Subject: [PATCH 2/2] Actually fixing the issue --- js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js b/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js index 1d647fbb924..dc80e27ae43 100644 --- a/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js +++ b/js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js @@ -33,7 +33,7 @@ export default class RecoveryPhrase extends Component { accountNameError: ERRORS.noName, isValidPass: true, isValidName: false, - isValidPhrase: false, + isValidPhrase: true, passwordHint: '', password1: '', password1Error: null,