diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/lib/authify.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-client/lib/authify.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/lib/authify.js b/deps/npm/node_modules/npm-registry-client/lib/authify.js index 4d1a4dd4aba..0a259757b30 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/authify.js +++ b/deps/npm/node_modules/npm-registry-client/lib/authify.js @@ -2,8 +2,8 @@ module.exports = authify function authify (authed, parsed, headers, credentials) { if (credentials && credentials.token) { - this.log.verbose("request", "using bearer token for auth") - headers.authorization = "Bearer " + credentials.token + this.log.verbose('request', 'using bearer token for auth') + headers.authorization = 'Bearer ' + credentials.token return null } @@ -12,11 +12,10 @@ function authify (authed, parsed, headers, credentials) { if (credentials && credentials.username && credentials.password) { var username = encodeURIComponent(credentials.username) var password = encodeURIComponent(credentials.password) - parsed.auth = username + ":" + password - } - else { + parsed.auth = username + ':' + password + } else { return new Error( - "This request requires auth credentials. Run `npm login` and repeat the request." + 'This request requires auth credentials. Run `npm login` and repeat the request.' ) } } |