Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2020-11-10 23:27:59 +0300
committerisaacs <i@izs.me>2020-11-13 22:22:56 +0300
commit2a80c67ef8c12c3d9d254f5be6293a6461067d99 (patch)
tree8fa29e311d962e48b3701eb810bd9fc5c7b37766 /lib/utils
parent786e36404068fd51657ddac766e066a98754edbf (diff)
fix: legacy auth tokens
Add legacy `_auth` token to flatOptions in order to support it when reaching out to registries. Fixes: #2008 Credit: @ruyadorno Close: #2153 Reviewed-by: @isaacs
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/config.js2
-rw-r--r--lib/utils/flat-options.js1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/config.js b/lib/utils/config.js
index f9de6e9a7..6abb502e2 100644
--- a/lib/utils/config.js
+++ b/lib/utils/config.js
@@ -52,6 +52,7 @@ const defaults = {
'always-auth': false,
audit: true,
'audit-level': null,
+ _auth: null,
'auth-type': 'legacy',
before: null,
'bin-links': true,
@@ -191,6 +192,7 @@ const types = {
all: Boolean,
'allow-same-version': Boolean,
also: [null, 'dev', 'development'],
+ _auth: [null, String],
'always-auth': Boolean,
audit: Boolean,
'audit-level': ['low', 'moderate', 'high', 'critical', 'none', null],
diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js
index be62c5a4c..8b6864aa8 100644
--- a/lib/utils/flat-options.js
+++ b/lib/utils/flat-options.js
@@ -50,6 +50,7 @@ const flatten = obj => ({
alwaysAuth: obj['always-auth'],
audit: obj.audit,
auditLevel: obj['audit-level'],
+ _auth: obj._auth,
authType: obj['auth-type'],
ssoType: obj['sso-type'],
ssoPollFrequency: obj['sso-poll-frequency'],