Passwords are valid by default (#4075)

* Passwords are valid by default #4059

* Actually fixing the issue
This commit is contained in:
Nicolas Gotchac 2017-01-06 17:56:57 +01:00 committed by Jaco Greeff
parent a7f23cbaed
commit 761ed913a8
5 changed files with 12 additions and 9 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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)) {

View File

@ -31,9 +31,9 @@ export default class RecoveryPhrase extends Component {
state = {
accountName: '',
accountNameError: ERRORS.noName,
isValidPass: false,
isValidPass: true,
isValidName: false,
isValidPhrase: false,
isValidPhrase: true,
passwordHint: '',
password1: '',
password1Error: null,

View File

@ -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) => {