From a80fe6612642c160452847033f81c97ba83a079e Mon Sep 17 00:00:00 2001 From: varjolintu Date: Mon, 11 Mar 2024 16:17:39 +0200 Subject: [PATCH] Add exceptions to Passkeys handling --- keepassxc-browser/content/passkeys-utils.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/passkeys-utils.js b/keepassxc-browser/content/passkeys-utils.js index 1ee553a..33d77e4 100644 --- a/keepassxc-browser/content/passkeys-utils.js +++ b/keepassxc-browser/content/passkeys-utils.js @@ -94,6 +94,11 @@ kpxcPasskeysUtils.buildCredentialCreationOptions = function(pkOptions, sameOrigi publicKey.user.id = arrayBufferToBase64(pkOptions.user.id); publicKey.user.name = pkOptions.user.name; + // TODO: Disable after fixed in KeePassXC side + if (!publicKey.rp.id) { + publicKey.rp.id = window.location.hostname; + } + return publicKey; } catch (e) { console.log(e); @@ -125,7 +130,7 @@ kpxcPasskeysUtils.buildCredentialRequestOptions = function(pkOptions, sameOrigin const arr = { id: arrayBufferToBase64(cred.id), - transports: transports, + transports: [ ...transports, 'internal' ], type: cred.type }; @@ -133,6 +138,11 @@ kpxcPasskeysUtils.buildCredentialRequestOptions = function(pkOptions, sameOrigin } } + // TODO: Disable after fixed in KeePassXC side + if (!publicKey.rpId) { + publicKey.rpId = window.location.hostname; + } + return publicKey; } catch (e) { console.log(e);