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:
authornlf <quitlahok@gmail.com>2022-08-02 22:57:18 +0300
committerGitHub <noreply@github.com>2022-08-02 22:57:18 +0300
commitfd030c86b1e01b7df1b9d73fda07496742a4737f (patch)
treee44b6e3fdc0c429582e08d73059dd8e797f1e659 /node_modules
parentd315ead7a7f6d531eb57cfa4350bb08949c60997 (diff)
deps: npm-profile@6.2.1 (#5245)
Diffstat (limited to 'node_modules')
-rw-r--r--node_modules/npm-profile/lib/index.js9
-rw-r--r--node_modules/npm-profile/package.json2
2 files changed, 5 insertions, 6 deletions
diff --git a/node_modules/npm-profile/lib/index.js b/node_modules/npm-profile/lib/index.js
index e4ac5622e..ce78882a5 100644
--- a/node_modules/npm-profile/lib/index.js
+++ b/node_modules/npm-profile/lib/index.js
@@ -56,13 +56,11 @@ const webAuth = (opener, opts, body) => {
const { hostname } = opts
body.hostname = hostname || os.hostname()
const target = '/-/v1/login'
+ const doneEmitter = new EventEmitter()
return fetch(target, {
...opts,
method: 'POST',
body,
- headers: {
- 'npm-use-webauthn': opts.authType === 'webauthn',
- },
}).then(res => {
return Promise.all([res, res.json()])
}).then(([res, content]) => {
@@ -75,8 +73,6 @@ const webAuth = (opener, opts, body) => {
}).then(({ doneUrl, loginUrl }) => {
log.verbose('web auth', 'opening url pair')
- const doneEmitter = new EventEmitter()
-
const openPromise = opener(loginUrl, doneEmitter)
const webAuthCheckPromise = webAuthCheckLogin(doneUrl, { ...opts, cache: false })
.then(authResult => {
@@ -93,6 +89,9 @@ const webAuth = (opener, opts, body) => {
([, authResult]) => authResult
)
}).catch(er => {
+ // cancel open prompt if it's present
+ doneEmitter.emit('abort')
+
if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) {
throw new WebLoginNotSupported('POST', {
status: er.statusCode,
diff --git a/node_modules/npm-profile/package.json b/node_modules/npm-profile/package.json
index bd4ebd317..457a1fb09 100644
--- a/node_modules/npm-profile/package.json
+++ b/node_modules/npm-profile/package.json
@@ -1,6 +1,6 @@
{
"name": "npm-profile",
- "version": "6.2.0",
+ "version": "6.2.1",
"description": "Library for updating an npmjs.com profile",
"keywords": [],
"author": "GitHub Inc.",