Skip to content

Instantly share code, notes, and snippets.

@acastellana
Created January 27, 2017 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acastellana/478f8596e85e57ddc49e41b82deb5bca to your computer and use it in GitHub Desktop.
Save acastellana/478f8596e85e57ddc49e41b82deb5bca to your computer and use it in GitHub Desktop.
/**
* _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