Skip to content

Commit

Permalink
feat: default auth-type to web (#5551)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the default `auth-type` config value is now `web`
  • Loading branch information
wraithgar authored Sep 21, 2022
1 parent 0d90a01 commit 66ed584
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/content/commands/npm-adduser.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/commands/npm-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ exit code.

#### `auth-type`

* Default: "legacy"
* Default: "web"
* Type: "legacy" or "web"

What authentication strategy to use with `login`.
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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\`.
Expand Down
4 changes: 2 additions & 2 deletions tap-snapshots/test/lib/commands/config.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ exit code.
#### \`auth-type\`
* Default: "legacy"
* Default: "web"
* Type: "legacy" or "web"
What authentication strategy to use with \`login\`.
Expand Down
4 changes: 4 additions & 0 deletions test/lib/commands/adduser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down Expand Up @@ -72,6 +73,7 @@ t.test('legacy', async t => {
}, { replace: true })
const { npm, home } = await loadMockNpm(t, {
config: {
'auth-type': 'legacy',
scope: '@myscope',
},
})
Expand Down Expand Up @@ -109,6 +111,7 @@ t.test('legacy', async t => {
'.npmrc': '@myscope:registry=https://diff-registry.npmjs.org',
},
config: {
'auth-type': 'legacy',
scope: '@myscope',
},
})
Expand Down Expand Up @@ -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': {},
},
Expand Down

0 comments on commit 66ed584

Please sign in to comment.