diff --git a/lam/templates/config/mainmanage.php b/lam/templates/config/mainmanage.php index f2a6bfec..06aee61b 100644 --- a/lam/templates/config/mainmanage.php +++ b/lam/templates/config/mainmanage.php @@ -473,7 +473,8 @@ printHeaderContents(_("Edit general settings"), '../..'); $database = new \LAM\LOGIN\WEBAUTHN\PublicKeyCredentialSourceRepositorySQLite(); if ($database->hasRegisteredCredentials()) { $row->add(new htmlSubTitle(_('Webauthn devices')), 12); - $row->add(new htmlResponsiveInputField(_('User DN'), 'webauthn_searchTerm', null, '252'), 12); + $webauthnSearchField = new htmlResponsiveInputField(_('User DN'), 'webauthn_searchTerm', null, '252'); + $row->add($webauthnSearchField, 12); $row->addVerticalSpacer('0.5rem'); $row->add(new htmlButton('webauthn_search', _('Search')), 12, 12, 12, 'text-center'); $resultDiv = new htmlDiv('webauthn_results', new htmlOutputText(''), array('lam-webauthn-results')); diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 3c7c782d..23476b2d 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -1551,6 +1551,16 @@ window.lam.webauthn.setupDeviceManagement = function() { if (searchButton) { searchButton.click(window.lam.webauthn.searchDevices); } + const searchInput = jQuery('#webauthn_searchTerm'); + if (searchInput) { + searchInput.keydown(function (event) { + if (event.keyCode == 13) { + event.preventDefault(); + searchButton.click(); + return false; + } + }); + } } /**