Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: default auth-type to web #5551

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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