From e4ebda9f3b9732ac53eae73643a3a8f77f5b2d12 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 21 Sep 2022 10:53:30 -0700 Subject: [PATCH] feat: default auth-type to web BREAKING CHANGE: the default `auth-type` config value is now `web` --- docs/content/commands/npm-adduser.md | 2 +- docs/content/commands/npm-login.md | 2 +- docs/content/using-npm/config.md | 2 +- lib/utils/config/definitions.js | 2 +- tap-snapshots/test/lib/commands/config.js.test.cjs | 4 ++-- tap-snapshots/test/lib/utils/config/definitions.js.test.cjs | 2 +- tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs | 2 +- test/lib/commands/adduser.js | 4 ++++ 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/content/commands/npm-adduser.md b/docs/content/commands/npm-adduser.md index 91f1195afbbee..96d361b031090 100644 --- a/docs/content/commands/npm-adduser.md +++ b/docs/content/commands/npm-adduser.md @@ -82,7 +82,7 @@ npm init --scope=@foo --yes #### `auth-type` -* Default: "legacy" +* Default: "web" * Type: "legacy" or "web" What authentication strategy to use with `login`. diff --git a/docs/content/commands/npm-login.md b/docs/content/commands/npm-login.md index 4f821c903b168..a3772dc882a9d 100644 --- a/docs/content/commands/npm-login.md +++ b/docs/content/commands/npm-login.md @@ -89,7 +89,7 @@ npm init --scope=@foo --yes #### `auth-type` -* Default: "legacy" +* Default: "web" * Type: "legacy" or "web" What authentication strategy to use with `login`. diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index 2b704bda2df4e..2b05c842f1190 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -217,7 +217,7 @@ exit code. #### `auth-type` -* Default: "legacy" +* Default: "web" * Type: "legacy" or "web" What authentication strategy to use with `login`. diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 5f10bd5e38898..fc39bddc70a42 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -237,7 +237,7 @@ define('audit-level', { }) define('auth-type', { - default: 'legacy', + default: 'web', type: ['legacy', 'web'], description: ` What authentication strategy to use with \`login\`. diff --git a/tap-snapshots/test/lib/commands/config.js.test.cjs b/tap-snapshots/test/lib/commands/config.js.test.cjs index 043dccd9ceab4..116ccea3a12ef 100644 --- a/tap-snapshots/test/lib/commands/config.js.test.cjs +++ b/tap-snapshots/test/lib/commands/config.js.test.cjs @@ -20,7 +20,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna "also": null, "audit": true, "audit-level": null, - "auth-type": "legacy", + "auth-type": "web", "before": null, "bin-links": true, "browser": null, @@ -173,7 +173,7 @@ allow-same-version = false also = null audit = true audit-level = null -auth-type = "legacy" +auth-type = "web" before = null bin-links = true browser = null diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 8eff450e7a926..ddf2396a6fe00 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -251,7 +251,7 @@ exit code. exports[`test/lib/utils/config/definitions.js TAP > config description for auth-type 1`] = ` #### \`auth-type\` -* Default: "legacy" +* Default: "web" * Type: "legacy" or "web" What authentication strategy to use with \`login\`. diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index 633b2da8e0472..2c51efec54afe 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -90,7 +90,7 @@ exit code. #### \`auth-type\` -* Default: "legacy" +* Default: "web" * Type: "legacy" or "web" What authentication strategy to use with \`login\`. diff --git a/test/lib/commands/adduser.js b/test/lib/commands/adduser.js index 4ff65e57f30dd..04fe8dc8c3147 100644 --- a/test/lib/commands/adduser.js +++ b/test/lib/commands/adduser.js @@ -25,6 +25,7 @@ t.test('legacy', async t => { 'process.stdout': new stream.PassThrough(), // to quiet readline }, { replace: true }) const { npm, home } = await loadMockNpm(t, { + config: { 'auth-type': 'legacy' }, homeDir: { // These all get cleaned up by config.setCredentialsByURI '.npmrc': [ @@ -72,6 +73,7 @@ t.test('legacy', async t => { }, { replace: true }) const { npm, home } = await loadMockNpm(t, { config: { + 'auth-type': 'legacy', scope: '@myscope', }, }) @@ -109,6 +111,7 @@ t.test('legacy', async t => { '.npmrc': '@myscope:registry=https://diff-registry.npmjs.org', }, config: { + 'auth-type': 'legacy', scope: '@myscope', }, }) @@ -142,6 +145,7 @@ t.test('legacy', async t => { 'process.stdout': new stream.PassThrough(), // to quiet readline }, { replace: true }) const { npm } = await loadMockNpm(t, { + config: { 'auth-type': 'legacy' }, homeDir: { '.npmrc': {}, },