mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #2042 from keepassxreboot/fix/passkeys_use_hostname
Passkeys: Use hostname instead of host
This commit is contained in:
commit
2ea6f08235
1 changed files with 5 additions and 5 deletions
|
|
@ -46,9 +46,9 @@ kpxcPasskeysUtils.buildCredentialCreationOptions = function(pkOptions) {
|
|||
}
|
||||
|
||||
if (!pkOptions.rp.id) {
|
||||
pkOptions.rp.id = window.location.host;
|
||||
pkOptions.rp.name = window.location.host;
|
||||
} else if (!window.location.host.endsWith(pkOptions.rp.id)) {
|
||||
pkOptions.rp.id = window.location.hostname;
|
||||
pkOptions.rp.name = window.location.hostname;
|
||||
} else if (!window.location.hostname.endsWith(pkOptions.rp.id)) {
|
||||
throw new DOMException('Site domain differs from RP ID', DOMException.SecurityError);
|
||||
}
|
||||
|
||||
|
|
@ -102,8 +102,8 @@ kpxcPasskeysUtils.buildCredentialRequestOptions = function(pkOptions) {
|
|||
checkErrors(pkOptions);
|
||||
|
||||
if (!pkOptions.rpId) {
|
||||
pkOptions.rpId = window.location.host;
|
||||
} else if (!window.location.host.endsWith(pkOptions.rpId)) {
|
||||
pkOptions.rpId = window.location.hostname;
|
||||
} else if (!window.location.hostname.endsWith(pkOptions.rpId)) {
|
||||
throw new DOMException('Site domain differs from RP ID', DOMException.SecurityError);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue