Socket
Socket
Sign inDemoInstall

heroku-cli-util

Package Overview
Dependencies
Maintainers
2
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-cli-util - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "heroku-cli-util",
"version": "2.0.0",
"version": "2.0.1",
"description": "Set of helpful CLI utilities",

@@ -5,0 +5,0 @@ "main": "cli.js",

'use strict';
let Heroku = require('heroku-client');
let prompt = require('./prompt');
let util = require('./util');
module.exports = function preauth (app, token, cb) {
prompt('Two-factor code', function (second_factor) {
let heroku = new Heroku({token: token});
return heroku.request({
method: 'PUT',
path: `/apps/${app}/pre-authorizations`,
headers: {
'Heroku-Two-Factor-Code': second_factor
}
}, cb);
function preauth (app, heroku) {
return new Promise(function (fulfill, reject) {
prompt.prompt('Two-factor code').then(function (second_factor) {
fulfill(heroku.request({
method: 'PUT',
path: `/apps/${app}/pre-authorizations`,
headers: {
'Heroku-Two-Factor-Code': second_factor
}
}));
}).catch(reject);
});
};
}
module.exports = util.promiseOrCallback(preauth);

@@ -140,8 +140,5 @@ # heroku-cli-util

var h = require('heroku-cli-util');
h.preauth("APPNAME", "APITOKEN", function (err) {
console.log('preauthed');
});
yield h.preauth("APPNAME", heroku);
```
## Tests

@@ -148,0 +145,0 @@

@@ -12,3 +12,3 @@ require('chai').should();

errors.error('foobar');
console.stderr.should.contain(' \u001b[41m!\u001b[49m foobar\n');
console.stderr.should.contain(' ! foobar\n');
});

@@ -18,4 +18,4 @@

errors.warn('foobar');
console.stderr.should.contain(' \u001b[43m!\u001b[49m foobar\n');
console.stderr.should.contain(' ! foobar\n');
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc