heroku-cli-util
Advanced tools
Comparing version 6.1.17 to 6.2.0
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83735
4