From e33bd9d3e80e6b7a8f9156c4ef0c715b73c8c251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=B8ller=20Ellehauge?= Date: Mon, 23 May 2022 20:59:45 +0200 Subject: [PATCH 1/3] feat: set 'npm-use-webauth' header depending on option --- lib/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/index.js b/lib/index.js index 74a8084..ea999d1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -59,6 +59,9 @@ const webAuth = (opener, opts, body) => { ...opts, method: 'POST', body, + headers: { + 'npm-use-webauth': opts.useWebauth, + }, }).then(res => { return Promise.all([res, res.json()]) }).then(([res, content]) => { From 88b9be50826a01553871e35853c738a98e331b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=B8ller=20Ellehauge?= Date: Tue, 24 May 2022 20:59:36 +0200 Subject: [PATCH 2/3] Change option --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index ea999d1..13e5578 100644 --- a/lib/index.js +++ b/lib/index.js @@ -60,7 +60,7 @@ const webAuth = (opener, opts, body) => { method: 'POST', body, headers: { - 'npm-use-webauth': opts.useWebauth, + 'npm-use-webauth': opts.authType === 'webauthn', }, }).then(res => { return Promise.all([res, res.json()]) From 9c79079620328e10dafed9887205ac8347e7bb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=B8ller=20Ellehauge?= Date: Tue, 24 May 2022 21:03:52 +0200 Subject: [PATCH 3/3] Change header name --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 13e5578..8de1722 100644 --- a/lib/index.js +++ b/lib/index.js @@ -60,7 +60,7 @@ const webAuth = (opener, opts, body) => { method: 'POST', body, headers: { - 'npm-use-webauth': opts.authType === 'webauthn', + 'npm-use-webauthn': opts.authType === 'webauthn', }, }).then(res => { return Promise.all([res, res.json()])