@martinfors
Thank you for your review and support; I really appreciate it. Feedback like yours helps me make the plugin more powerful and reduce errors.
It would be even better if you could share this in the support forum for wider visibility.
I will carefully check your points and try to reproduce the issue to ensure we catch them and provide a solid solution in the next releases.
—–
You can try this snippet — it will detect your subdomain rather than just the main domain:
add_filter('secure_passkeys_web_authn_relying_party_id', function ($domain) {
$allowed_domains = [
'sub1.domain.com',
'sub2.domain.com',
];
$host = $_SERVER['HTTP_HOST'] ?? '';
if (in_array($host, $allowed_domains, true)) {
return $host;
}
return $domain;
});
Thank you
Should I restart as a support thread?
I can’t even get the script above to be used. I am calling it with:
add_filter(‘secure_passkeys_web_authn_relying_party_id’, array($obj_custom_login, ‘secure_passkeys_web_authn_relying_party_id’));
…and then in the class I run:
function secure_passkeys_web_authn_relying_party_id($domain)
{
$allowed_domains = [];
$result = get_sites();
foreach($result as $r)
{
$allowed_domains[] = $r->domain;
}
$host = ($_SERVER[‘HTTP_HOST’] ?? ”);
error_log(__FUNCTION__.”: “.$host.” in “.var_export($allowed_domains, true));
if(in_array($host, $allowed_domains, true))
{
return $host;
}
return $domain;
}
…but nothing is saved to the log and no notification is displayed.
For a clearer user experience I would also change “Enable or disable the restriction for the maximum number of passkeys per user.” into “Enable the restriction for the maximum number of passkeys per user.”. “Enable or disable…” just confuses users in the settings. When the checkbox is checked it is enabled, and when it is unchecked is disabled.
And thanks for your quick reply!