Comparing version 0.20.5 to 0.21.0
@@ -29,3 +29,10 @@ var request = require("request") | ||
} else { | ||
return authenticateAndSave(callback) | ||
if (req.passintoken){ | ||
helpers.space() | ||
helpers.trunc("Invalid token") | ||
helpers.space() | ||
process.exit(1) | ||
} else { | ||
return authenticateAndSave(callback) | ||
} | ||
} | ||
@@ -32,0 +39,0 @@ }) |
@@ -8,4 +8,11 @@ var path = require("path") | ||
module.exports = function(req, next){ | ||
req.creds = localCreds(req.endpoint).get() | ||
req.passintoken = req.argv.token || process.env['SURGE_TOKEN'] || process.env['TRAVIS_SURGE_TOKEN'] || null | ||
if (req.passintoken){ | ||
req.creds = { email: "token", token: req.passintoken } | ||
} else { | ||
req.creds = localCreds(req.endpoint).get() | ||
} | ||
next() | ||
} |
@@ -23,15 +23,2 @@ var path = require("path") | ||
if (process.env['SURGE_LOGIN'] && process.env['SURGE_TOKEN']) { | ||
return { | ||
"email": process.env['SURGE_LOGIN'], | ||
"token": process.env['SURGE_TOKEN'] | ||
} | ||
// Fallback to original implementation | ||
} else if (process.env['TRAVIS_SURGE_LOGIN'] && process.env['TRAVIS_SURGE_TOKEN']) { | ||
return { | ||
"email": process.env['TRAVIS_SURGE_LOGIN'], | ||
"token": process.env['TRAVIS_SURGE_TOKEN'] | ||
} | ||
} | ||
if (obj.hasOwnProperty(host)) { | ||
@@ -38,0 +25,0 @@ return { |
var helpers = require("./util/helpers.js") | ||
module.exports = function(req, next){ | ||
module.exports = function(req, next){ | ||
if (req.creds == null) { | ||
@@ -5,0 +6,0 @@ helpers.trunc(("Welcome to " + (req.config.name || "Surge").underline + "!").blue + (" (" + req.config.platform +")").grey) |
@@ -10,3 +10,3 @@ var helpers = require("./util/helpers") | ||
helpers.space() | ||
var str = req.creds.email.underline.grey | ||
var str = req.account.email.underline.grey | ||
if (req.account.plan){ | ||
@@ -13,0 +13,0 @@ str = str + (" - " + req.account.plan.name).grey |
{ | ||
"name": "surge", | ||
"version": "0.20.5", | ||
"version": "0.21.0", | ||
"description": "CDN for front-end developers", | ||
@@ -5,0 +5,0 @@ "author": "Brock Whitten <brock@chloi.io>", |
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
26
75055