aboutsummaryrefslogtreecommitdiff
path: root/node_modules/registry-auth-token/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/registry-auth-token/index.js')
-rw-r--r--node_modules/registry-auth-token/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/node_modules/registry-auth-token/index.js b/node_modules/registry-auth-token/index.js
index 0fc8528b2..d68f7eeb4 100644
--- a/node_modules/registry-auth-token/index.js
+++ b/node_modules/registry-auth-token/index.js
@@ -100,7 +100,9 @@ function getTokenForUsernameAndPassword (username, password) {
// passwords are base64 encoded, so we need to decode it
// See https://github.com/npm/npm/blob/v3.10.6/lib/config/set-credentials-by-uri.js#L26
- var pass = decodeBase64(password)
+ var pass = decodeBase64(password.replace(/^\$\{?([^}]*)\}?$/, function (fullMatch, envVar) {
+ return process.env[envVar]
+ }))
// a basic auth token is base64 encoded 'username:password'
// See https://github.com/npm/npm/blob/v3.10.6/lib/config/get-credentials-by-uri.js#L70