Skip to content

Commit

Permalink
Merge pull request keepassxreboot#2141 from keepassxreboot/fix/passke…
Browse files Browse the repository at this point in the history
…ys_add_exceptions

Add exceptions to Passkeys handling
  • Loading branch information
varjolintu authored Mar 12, 2024
2 parents 14f2c9a + a80fe66 commit 22af4ac
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion keepassxc-browser/content/passkeys-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -125,14 +130,19 @@ kpxcPasskeysUtils.buildCredentialRequestOptions = function(pkOptions, sameOrigin

const arr = {
id: arrayBufferToBase64(cred.id),
transports: transports,
transports: [ ...transports, 'internal' ],
type: cred.type
};

publicKey.allowCredentials.push(arr);
}
}

// TODO: Disable after fixed in KeePassXC side
if (!publicKey.rpId) {
publicKey.rpId = window.location.hostname;
}

return publicKey;
} catch (e) {
console.log(e);
Expand Down

0 comments on commit 22af4ac

Please sign in to comment.