From b0aa1974de359685410f407274d8d5095fdb0f06 Mon Sep 17 00:00:00 2001 From: Felix Deibert <24978665+deibertf@users.noreply.github.com> Date: Thu, 16 Feb 2023 00:10:01 +0100 Subject: [PATCH 1/3] Update webauthn.js --- resources/js/webauthn.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/js/webauthn.js b/resources/js/webauthn.js index 4350d2c..3775af6 100644 --- a/resources/js/webauthn.js +++ b/resources/js/webauthn.js @@ -156,7 +156,9 @@ class WebAuthn { * @returns {Promise} */ #fetch(data, route, headers = {}) { - return fetch(route, { + + let url = new URL(route, window.location.origin).href; + return fetch(url, { method: "POST", credentials: this.#includeCredentials ? "include" : "same-origin", redirect: "error", From 0b381551e000eb8cce987f9a044b2f5dbd912b56 Mon Sep 17 00:00:00 2001 From: Felix Deibert <24978665+deibertf@users.noreply.github.com> Date: Thu, 16 Feb 2023 00:34:39 +0100 Subject: [PATCH 2/3] Update webauthn.js --- resources/js/webauthn.js | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/js/webauthn.js b/resources/js/webauthn.js index 3775af6..409421a 100644 --- a/resources/js/webauthn.js +++ b/resources/js/webauthn.js @@ -315,6 +315,7 @@ class WebAuthn { const publicKeyCredential = this.#parseOutgoingCredentials(credentials); Object.assign(publicKeyCredential, response); + Object.assign(publicKeyCredential, request); return await this.#fetch(publicKeyCredential, this.#routes.register).then(WebAuthn.#handleResponse); } From 73502cea4e315af115bec8d67f0ce9880ba5a3ee Mon Sep 17 00:00:00 2001 From: Italo Date: Wed, 15 Feb 2023 22:16:02 -0300 Subject: [PATCH 3/3] Use const, minor line break fix. --- resources/js/webauthn.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/webauthn.js b/resources/js/webauthn.js index 409421a..74c4e02 100644 --- a/resources/js/webauthn.js +++ b/resources/js/webauthn.js @@ -156,8 +156,8 @@ class WebAuthn { * @returns {Promise} */ #fetch(data, route, headers = {}) { - - let url = new URL(route, window.location.origin).href; + const url = new URL(route, window.location.origin).href; + return fetch(url, { method: "POST", credentials: this.#includeCredentials ? "include" : "same-origin",