Created
January 27, 2017 14:10
-
-
Save acastellana/478f8596e85e57ddc49e41b82deb5bca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* _checkAccess() Ensure that the user is authentic by checking his password and setting the private key to this.common | |
*/ | |
checkAccess(){ | |
// Decrypt/generate private key and check it. Returned private key is contained into this.common | |
if (!CryptoHelpers.passwordToPrivatekeyClear(this.common, this._Wallet.currentAccount, this._Wallet.algo, true)) { | |
this._Alert.invalidPassword(); | |
// Enable send button | |
this.buttonDisabled = false; | |
return false; | |
} else if (!CryptoHelpers.checkAddress(this.common.privateKey, this._Wallet.network, this._Wallet.currentAccount.address)) { | |
this._Alert.invalidPassword(); | |
// Enable send button | |
this.buttonDisabled = false; | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment