Skip to content

Commit

Permalink
Add exceptions to Passkeys handling
Browse files Browse the repository at this point in the history
  • Loading branch information
varjolintu committed Mar 11, 2024
1 parent 14f2c9a commit a80fe66
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 a80fe66

Please sign in to comment.