summaryrefslogtreecommitdiff
path: root/deps/npm/lib/config/get-credentials-by-uri.js
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2016-03-29 23:30:51 -0700
committerMyles Borins <mborins@us.ibm.com>2016-04-01 14:47:39 -0700
commit0928584444ac6edf1ead0b93c9d05b1124183702 (patch)
treef64c5646b8e2817009e7afe97c2670c73d38a7eb /deps/npm/lib/config/get-credentials-by-uri.js
parent39de601e1c3eda92eb2e37eca4e6aa960f206f39 (diff)
downloadnode-new-0928584444ac6edf1ead0b93c9d05b1124183702.tar.gz
deps: upgrade npm to 3.8.3
PR-URL: https://github.com/npm/node/pull/6 Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'deps/npm/lib/config/get-credentials-by-uri.js')
-rw-r--r--deps/npm/lib/config/get-credentials-by-uri.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/deps/npm/lib/config/get-credentials-by-uri.js b/deps/npm/lib/config/get-credentials-by-uri.js
index a073a594a5..19779c4137 100644
--- a/deps/npm/lib/config/get-credentials-by-uri.js
+++ b/deps/npm/lib/config/get-credentials-by-uri.js
@@ -20,6 +20,14 @@ function getCredentialsByURI (uri) {
alwaysAuth: undefined
}
+ // used to override scope matching for tokens as well as legacy auth
+ if (this.get(nerfed + ':always-auth') !== undefined) {
+ var val = this.get(nerfed + ':always-auth')
+ c.alwaysAuth = val === 'false' ? false : !!val
+ } else if (this.get('always-auth') !== undefined) {
+ c.alwaysAuth = this.get('always-auth')
+ }
+
if (this.get(nerfed + ':_authToken')) {
c.token = this.get(nerfed + ':_authToken')
// the bearer token is enough, don't confuse things
@@ -58,13 +66,6 @@ function getCredentialsByURI (uri) {
c.email = this.get('email')
}
- if (this.get(nerfed + ':always-auth') !== undefined) {
- var val = this.get(nerfed + ':always-auth')
- c.alwaysAuth = val === 'false' ? false : !!val
- } else if (this.get('always-auth') !== undefined) {
- c.alwaysAuth = this.get('always-auth')
- }
-
if (c.username && c.password) {
c.auth = new Buffer(c.username + ':' + c.password).toString('base64')
}