@heroku-cli/command
Advanced tools
Comparing version 8.4.1 to 8.5.0
@@ -14,2 +14,3 @@ "use strict"; | ||
const hostname = os.hostname(); | ||
const thirtyDays = 60 * 60 * 24 * 30; | ||
const headers = (token) => ({ headers: { accept: 'application/vnd.heroku+json; version=3', authorization: `Bearer ${token}` } }); | ||
@@ -32,2 +33,4 @@ class Login { | ||
cli_ux_1.default.error('Cannot log in with HEROKU_API_KEY set'); | ||
if (opts.expiresIn && opts.expiresIn > thirtyDays) | ||
cli_ux_1.default.error('Cannot set an expiration longer than thirty days'); | ||
await netrc_parser_1.default.load(); | ||
@@ -184,6 +187,7 @@ const previousEntry = netrc_parser_1.default.machines['api.heroku.com']; | ||
catch (err) { | ||
if (err.body && err.body.id === 'device_trust_required') { | ||
err.body.message = 'The interactive flag requires Two-Factor Authentication to be enabled on your account. Please use heroku login.'; | ||
throw err; | ||
} | ||
if (!err.body || err.body.id !== 'two_factor') { | ||
if (err.body.id === 'device_trust_required') { | ||
err.body.message = 'The interactive flag requires Two-Factor Authentication to be enabled on your account. Please use heroku login.'; | ||
} | ||
throw err; | ||
@@ -214,3 +218,3 @@ } | ||
description: `Heroku CLI login from ${hostname}`, | ||
expires_in: opts.expiresIn || 60 * 60 * 24 * 365 // 1 year | ||
expires_in: opts.expiresIn || thirtyDays | ||
} | ||
@@ -217,0 +221,0 @@ }); |
{ | ||
"name": "@heroku-cli/command", | ||
"description": "base class for Heroku CLI commands", | ||
"version": "8.4.1", | ||
"version": "8.5.0", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/heroku/heroku-cli-command/issues", |
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
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
60674
1261