diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-fetch/auth.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-fetch/auth.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/deps/npm/node_modules/npm-registry-fetch/auth.js b/deps/npm/node_modules/npm-registry-fetch/auth.js index f4f7316db1..fa696b97dd 100644 --- a/deps/npm/node_modules/npm-registry-fetch/auth.js +++ b/deps/npm/node_modules/npm-registry-fetch/auth.js @@ -9,7 +9,11 @@ function getAuth (registry, opts) { opts = config(opts) let AUTH = {} const regKey = registry && registryKey(registry) + if (opts.forceAuth) { + opts = opts.forceAuth + } const doKey = (key, alias) => addKey(opts, AUTH, regKey, key, alias) + doKey('token') doKey('_authToken', 'token') doKey('username') doKey('password') @@ -26,11 +30,11 @@ function getAuth (registry, opts) { } function addKey (opts, obj, scope, key, objKey) { - if (opts.get(key)) { - obj[objKey || key] = opts.get(key) + if (opts[key]) { + obj[objKey || key] = opts[key] } - if (scope && opts.get(`${scope}:${key}`)) { - obj[objKey || key] = opts.get(`${scope}:${key}`) + if (scope && opts[`${scope}:${key}`]) { + obj[objKey || key] = opts[`${scope}:${key}`] } } |