29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-26 07:13:21 +00:00

[4.4] Improve Totp code input (#42608)

* [4.4] Improve Totp code input

* Fix code input pattern attribute

* Specify autocomplete on code input

* [4.4] Improve Totp code input

* Fix typo

* [4.4] Improve Totp code input

* Fix mixed single/double quotes

* Add code input required attribute to disable submitting an empty code value

* [4.4] Improve Totp code input

* Apply same fix to Email Totp:
  - Fix code input pattern attribute
  - Specify autocomplete on code input
  - Add code input required attribute to disable submitting an empty code value
  - Fix mixed single/double quotes

---------
This commit is contained in:
sitecode 2024-01-19 09:44:06 -05:00 committed by GitHub
parent deae2f0dea
commit 302ce23570
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -190,7 +190,7 @@ class Email extends CMSPlugin implements SubscriberInterface
'input_type' => 'text',
// The attributes for the HTML input box.
'input_attributes' => [
'pattern' => "{0,9}", 'maxlength' => "6", 'inputmode' => "numeric",
'pattern' => '[0-9]{6}', 'maxlength' => '6', 'inputmode' => 'numeric', 'required' => 'true', 'autocomplete' => 'one-time-code', 'aria-autocomplete' => 'none',
],
// Placeholder text for the HTML input box. Leave empty if you don't need it.
'placeholder' => Text::_('PLG_MULTIFACTORAUTH_EMAIL_LBL_SETUP_PLACEHOLDER'),
@ -264,7 +264,7 @@ class Email extends CMSPlugin implements SubscriberInterface
'field_type' => 'input',
'input_type' => 'text',
'input_attributes' => [
'pattern' => "{0,9}", 'maxlength' => "6", 'inputmode' => "numeric",
'pattern' => '[0-9]{6}', 'maxlength' => '6', 'inputmode' => 'numeric', 'required' => 'true', 'autocomplete' => 'one-time-code', 'aria-autocomplete' => 'none',
],
'input_value' => '',
'placeholder' => Text::_('PLG_MULTIFACTORAUTH_EMAIL_LBL_SETUP_PLACEHOLDER'),

View File

@ -150,7 +150,7 @@ class Totp extends CMSPlugin implements SubscriberInterface
'input_type' => 'text',
// The attributes for the HTML input box.
'input_attributes' => [
'pattern' => "{0,9}", 'maxlength' => "6", 'inputmode' => "numeric",
'pattern' => '[0-9]{6}', 'maxlength' => '6', 'inputmode' => 'numeric', 'required' => 'true', 'autocomplete' => 'one-time-code', 'aria-autocomplete' => 'none',
],
// Placeholder text for the HTML input box. Leave empty if you don't need it.
'placeholder' => '',
@ -239,7 +239,7 @@ class Totp extends CMSPlugin implements SubscriberInterface
],
'input_type' => $isConfigured ? 'hidden' : 'text',
'input_attributes' => [
'pattern' => "{0,9}", 'maxlength' => "6", 'inputmode' => "numeric",
'pattern' => '[0-9]{6}', 'maxlength' => '6', 'inputmode' => 'numeric', 'required' => 'true', 'autocomplete' => 'one-time-code', 'aria-autocomplete' => 'none',
],
'input_value' => '',
'placeholder' => Text::_('PLG_MULTIFACTORAUTH_TOTP_LBL_SETUP_PLACEHOLDER'),