Socket
Socket
Sign inDemoInstall

heroku-cli-util

Package Overview
Dependencies
22
Maintainers
5
Versions
155
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.1.17 to 6.2.0

12

lib/auth.js

@@ -13,3 +13,3 @@ 'use strict'

function createOAuthToken (username, password, secondFactor) {
function createOAuthToken (username, password, expiresIn, secondFactor) {
const os = require('os')

@@ -28,6 +28,6 @@

description: `Heroku CLI login from ${os.hostname()} at ${new Date()}`,
expires_in: 60 * 60 * 24 * 365 // 1 year
expires_in: expiresIn || 60 * 60 * 24 * 365 // 1 year
}
}).then(function (auth) {
return {token: auth.access_token.token, email: auth.user.email}
return {token: auth.access_token.token, email: auth.user.email, expires_in: auth.access_token.expires_in}
})

@@ -47,3 +47,3 @@ }

function * loginUserPass ({save}) {
function * loginUserPass ({save, expires_in}) {
const {prompt} = require('./prompt')

@@ -57,7 +57,7 @@

try {
auth = yield createOAuthToken(email, password)
auth = yield createOAuthToken(email, password, expires_in)
} catch (err) {
if (!err.body || err.body.id !== 'two_factor') throw err
let secondFactor = yield prompt('Two-factor code', {mask: true})
auth = yield createOAuthToken(email, password, secondFactor)
auth = yield createOAuthToken(email, password, expires_in, secondFactor)
}

@@ -64,0 +64,0 @@ if (save) saveToken(auth)

{
"name": "heroku-cli-util",
"description": "Set of helpful CLI utilities",
"version": "6.1.17",
"version": "6.2.0",
"author": "Jeff Dickey (@dickeyxxx)",

@@ -6,0 +6,0 @@ "bugs": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc