|
@ -45,8 +45,9 @@ class Login extends React.Component { |
|
|
trimPassphraseTimer: null, |
|
|
trimPassphraseTimer: null, |
|
|
displayLoginSettingsDropdown: false, |
|
|
displayLoginSettingsDropdown: false, |
|
|
displayLoginSettingsDropdownSection: null, |
|
|
displayLoginSettingsDropdownSection: null, |
|
|
shouldEncryptPassword: false, |
|
|
shouldEncryptSeed: false, |
|
|
encryptKey: '', |
|
|
encryptKey: '', |
|
|
|
|
|
pubKey: '', |
|
|
decryptKey: '', |
|
|
decryptKey: '', |
|
|
selectedPin: '' |
|
|
selectedPin: '' |
|
|
}; |
|
|
}; |
|
@ -63,6 +64,7 @@ class Login extends React.Component { |
|
|
this.resizeLoginTextarea = this.resizeLoginTextarea.bind(this); |
|
|
this.resizeLoginTextarea = this.resizeLoginTextarea.bind(this); |
|
|
this.toggleLoginSettingsDropdown = this.toggleLoginSettingsDropdown.bind(this); |
|
|
this.toggleLoginSettingsDropdown = this.toggleLoginSettingsDropdown.bind(this); |
|
|
this.updateEncryptKey = this.updateEncryptKey.bind(this); |
|
|
this.updateEncryptKey = this.updateEncryptKey.bind(this); |
|
|
|
|
|
this.updatePubKey = this.updatePubKey.bind(this); |
|
|
this.updateDecryptKey = this.updateDecryptKey.bind(this); |
|
|
this.updateDecryptKey = this.updateDecryptKey.bind(this); |
|
|
this.loadPinList = this.loadPinList.bind(this); |
|
|
this.loadPinList = this.loadPinList.bind(this); |
|
|
} |
|
|
} |
|
@ -104,13 +106,13 @@ class Login extends React.Component { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
shouldEncryptPassword() { |
|
|
shouldEncryptSeed() { |
|
|
return this.state.shouldEncryptPassword; |
|
|
return this.state.shouldEncryptSeed; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
toggleShouldEncryptPassword() { |
|
|
toggleShouldEncryptSeed() { |
|
|
this.setState({ |
|
|
this.setState({ |
|
|
shouldEncryptPassword: !this.state.shouldEncryptPassword |
|
|
shouldEncryptSeed: !this.state.shouldEncryptSeed |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -120,6 +122,13 @@ class Login extends React.Component { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
updatePubKey(e) { |
|
|
|
|
|
this.setState({ |
|
|
|
|
|
pubKey: e.target.value |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateDecryptKey(e) { |
|
|
updateDecryptKey(e) { |
|
|
this.setState({ |
|
|
this.setState({ |
|
|
decryptKey: e.target.value |
|
|
decryptKey: e.target.value |
|
@ -173,6 +182,9 @@ class Login extends React.Component { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
componentWillReceiveProps(props) { |
|
|
componentWillReceiveProps(props) { |
|
|
|
|
|
if (props.login.pinList === "no pins") { |
|
|
|
|
|
props.login.pinList = []; |
|
|
|
|
|
} |
|
|
if (props && |
|
|
if (props && |
|
|
props.Main && |
|
|
props.Main && |
|
|
props.Main.isLoggedIn) { |
|
|
props.Main.isLoggedIn) { |
|
@ -275,15 +287,12 @@ class Login extends React.Component { |
|
|
loginPassPhraseSeedType: null, |
|
|
loginPassPhraseSeedType: null, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
console.log('LOGIN SEED', this.state.shouldEncryptPassword, this.state.encryptKey); |
|
|
if (this.state.shouldEncryptSeed) { |
|
|
|
|
|
Store.dispatch(encryptPassphrase(this.state.loginPassphrase, this.state.encryptKey, this.state.pubKey)); |
|
|
if (this.state.shouldEncryptPassword) { |
|
|
|
|
|
Store.dispatch(encryptPassphrase(this.state.loginPassphrase, this.state.encryptKey, 'blabla')); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log('selected pin', this.state.selectedPin); |
|
|
|
|
|
if (this.state.selectedPin) { |
|
|
if (this.state.selectedPin) { |
|
|
Store.dispatch(loginWithPin(this.state.decryptKey, 'blabla')); |
|
|
Store.dispatch(loginWithPin(this.state.decryptKey, this.state.selectedPin)); |
|
|
} else { |
|
|
} else { |
|
|
Store.dispatch( |
|
|
Store.dispatch( |
|
|
iguanaWalletPassphrase(this.state.loginPassphrase) |
|
|
iguanaWalletPassphrase(this.state.loginPassphrase) |
|
|