Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit 523e77c

Browse files
committed
Merge pull request #27 from gordonwritescode/master
fix login command to use proper bitauth method
2 parents 8909cae + 98fd8c6 commit 523e77c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

bin/bitpay.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (!fs.existsSync(HOME + '/.bitpay')) {
1313
}
1414

1515
bitpay
16-
.version('0.0.1')
16+
.version('0.0.2')
1717
.option('-o, --output [directory]', 'export directory for keys', HOME + '/.bitpay')
1818
.option('-i, --input [directory]', 'import directory for keys', HOME + '/.bitpay')
1919
.option('-p, --password [password]', 'password for encrypting/decrypting your key', '')
@@ -52,15 +52,15 @@ bitpay
5252
if (!fs.existsSync(bitpay.input + '/api.key')) {
5353
return console.log('Error:', 'Access key not found, did you run `bitpay keygen`?');
5454
}
55-
var secret = fs.readFileSync(bitpay.input + '/api.key').toString();
55+
var sin = fs.readFileSync(bitpay.input + '/api.pub').toString();
5656
var client = new BitPay();
5757
// handle errors
5858
client.on('error', function(err) {
5959
console.log('Error:', err);
6060
});
6161
// associate key
6262
client.as('public').post('clients', {
63-
id: bitauth.getSin(bitauth.decrypt(bitpay.password, secret)),
63+
id: sin,
6464
email: bitpay.email,
6565
label: 'node-bitpay-client'
6666
}, function(err, result) {

0 commit comments

Comments
 (0)