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
diff options
context:
space:
mode:
-rw-r--r--node_modules/npm-profile/lib/index.js23
-rw-r--r--node_modules/npm-profile/package.json6
-rw-r--r--package-lock.json14
-rw-r--r--package.json2
4 files changed, 32 insertions, 13 deletions
diff --git a/node_modules/npm-profile/lib/index.js b/node_modules/npm-profile/lib/index.js
index 74a808429..eb97c621d 100644
--- a/node_modules/npm-profile/lib/index.js
+++ b/node_modules/npm-profile/lib/index.js
@@ -2,6 +2,7 @@
const fetch = require('npm-registry-fetch')
const { HttpErrorBase } = require('npm-registry-fetch/lib/errors')
+const EventEmitter = require('events')
const os = require('os')
const { URL } = require('url')
const log = require('proc-log')
@@ -59,6 +60,9 @@ const webAuth = (opener, opts, body) => {
...opts,
method: 'POST',
body,
+ headers: {
+ 'npm-use-webauthn': opts.authType === 'webauthn',
+ },
}).then(res => {
return Promise.all([res, res.json()])
}).then(([res, content]) => {
@@ -70,8 +74,23 @@ const webAuth = (opener, opts, body) => {
return content
}).then(({ doneUrl, loginUrl }) => {
log.verbose('web auth', 'opening url pair')
- return opener(loginUrl).then(
- () => webAuthCheckLogin(doneUrl, { ...opts, cache: false })
+
+ const doneEmitter = new EventEmitter()
+
+ const openPromise = opener(loginUrl, doneEmitter)
+ const webAuthCheckPromise = webAuthCheckLogin(doneUrl, { ...opts, cache: false })
+ .then(authResult => {
+ log.verbose('web auth', 'done-check finished')
+
+ // cancel open prompt if it's present
+ doneEmitter.emit('abort')
+
+ return authResult
+ })
+
+ return Promise.all([openPromise, webAuthCheckPromise]).then(
+ // pick the auth result and pass it along
+ ([, authResult]) => authResult
)
}).catch(er => {
if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) {
diff --git a/node_modules/npm-profile/package.json b/node_modules/npm-profile/package.json
index 5e8f2d239..4f9da95d7 100644
--- a/node_modules/npm-profile/package.json
+++ b/node_modules/npm-profile/package.json
@@ -1,6 +1,6 @@
{
"name": "npm-profile",
- "version": "6.0.3",
+ "version": "6.1.0",
"description": "Library for updating an npmjs.com profile",
"keywords": [],
"author": "GitHub Inc.",
@@ -20,7 +20,7 @@
],
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
- "@npmcli/template-oss": "3.4.1",
+ "@npmcli/template-oss": "3.4.2",
"nock": "^13.2.4",
"tap": "^16.0.1"
},
@@ -44,6 +44,6 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
- "version": "3.4.1"
+ "version": "3.4.2"
}
}
diff --git a/package-lock.json b/package-lock.json
index bd694b173..d3fddb618 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -133,7 +133,7 @@
"npm-install-checks": "^5.0.0",
"npm-package-arg": "^9.0.2",
"npm-pick-manifest": "^7.0.1",
- "npm-profile": "^6.0.3",
+ "npm-profile": "^6.1.0",
"npm-registry-fetch": "^13.1.1",
"npm-user-validate": "^1.0.1",
"npmlog": "^6.0.2",
@@ -5173,9 +5173,9 @@
}
},
"node_modules/npm-profile": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.0.3.tgz",
- "integrity": "sha512-TVeHhnol2Iemud+Sr70/uqax5LnLJ9y361w+m5+Z7WYV2B1t6FhRDxDu72+yYYTvsgshkhnXEqbPjuD87kYXfA==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.1.0.tgz",
+ "integrity": "sha512-JHnBzSqS9xPa0M3g90zhaGElSVdxoAipGkraBaM6Jph2XiSiwFN1HmfRTqndYhDkXia2hWRWl8O5RbDvae++GA==",
"inBundle": true,
"dependencies": {
"npm-registry-fetch": "^13.0.1",
@@ -13646,9 +13646,9 @@
}
},
"npm-profile": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.0.3.tgz",
- "integrity": "sha512-TVeHhnol2Iemud+Sr70/uqax5LnLJ9y361w+m5+Z7WYV2B1t6FhRDxDu72+yYYTvsgshkhnXEqbPjuD87kYXfA==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.1.0.tgz",
+ "integrity": "sha512-JHnBzSqS9xPa0M3g90zhaGElSVdxoAipGkraBaM6Jph2XiSiwFN1HmfRTqndYhDkXia2hWRWl8O5RbDvae++GA==",
"requires": {
"npm-registry-fetch": "^13.0.1",
"proc-log": "^2.0.0"
diff --git a/package.json b/package.json
index cbbaa34db..f7c40bde5 100644
--- a/package.json
+++ b/package.json
@@ -102,7 +102,7 @@
"npm-install-checks": "^5.0.0",
"npm-package-arg": "^9.0.2",
"npm-pick-manifest": "^7.0.1",
- "npm-profile": "^6.0.3",
+ "npm-profile": "^6.1.0",
"npm-registry-fetch": "^13.1.1",
"npm-user-validate": "^1.0.1",
"npmlog": "^6.0.2",