Add autocomplete support for multifactor email code form field
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 12:07:47 +0000 (13:07 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 17:58:25 +0000 (18:58 +0100)
com.woltlab.wcf/templates/__multifactorEmailCodeField.tpl
wcfsetup/install/files/acp/templates/__multifactorEmailCodeField.tpl
wcfsetup/install/files/lib/system/user/multifactor/email/CodeFormField.class.php

index 7b596894d9cfd5593b858651920bb4c72c6d6929..804df0de788cdaf187b482914c5d6e76816198d9 100644 (file)
@@ -3,7 +3,7 @@
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
        *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{*
-       *}autocomplete="off" {*
+       *}{if $field->getAutoComplete() !== null}autocomplete="{$field->getAutoComplete()}" {/if}{*
        *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
        *}pattern="[0-9]*" {*
        *}inputmode="numeric"{*
index 7b596894d9cfd5593b858651920bb4c72c6d6929..804df0de788cdaf187b482914c5d6e76816198d9 100644 (file)
@@ -3,7 +3,7 @@
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
        *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{*
-       *}autocomplete="off" {*
+       *}{if $field->getAutoComplete() !== null}autocomplete="{$field->getAutoComplete()}" {/if}{*
        *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
        *}pattern="[0-9]*" {*
        *}inputmode="numeric"{*
index 24b111539d816d37be0f4155b2f55f048e23fb2a..0b2ef777f26ffd097d8e8ccf4adc874fb1681427 100644 (file)
@@ -26,6 +26,7 @@ class CodeFormField extends TextFormField {
                $this->minimumLength(EmailMultifactorMethod::LENGTH);
                $this->maximumLength(EmailMultifactorMethod::LENGTH);
                $this->addFieldClass('multifactorEmailCode');
+               $this->autoComplete('off');
                
                $placeholder = '';
                $gen = Helper::digitStream();