29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

[4.3] Fix javascript error on frontend MFA captive login page (#40330)

This commit is contained in:
Richard Fath 2023-05-06 02:01:45 +02:00 committed by GitHub
parent a2446398ec
commit b5f5db7710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@
document.addEventListener('DOMContentLoaded', () => {
const elCodeField = document.getElementById('users-mfa-code');
const elValidateButton = document.getElementById('users-mfa-captive-button-submit');
const elToolbarButton = document.getElementById('toolbar-user-mfa-submit').querySelector('button');
const elToolbarCustomElement = document.getElementById('toolbar-user-mfa-submit');
// Focus the code field. If the code field is hidden, focus the submit button (useful e.g. for WebAuthn)
if (
@ -21,8 +21,8 @@
if (elValidateButton) {
elValidateButton.focus();
}
if (elToolbarButton) {
elToolbarButton.focus();
if (elToolbarCustomElement) {
elToolbarCustomElement.querySelector('button').focus();
}
}