Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exceptions to Passkeys handling #2141

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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