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

index 1dde538f16bcfc1af971bb45e57976ad0a187f45..8f3a61ad64324d10e5da78b9e98adb711736c420 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}{*
        *}pattern="[0-9\s]*" {*
        *}inputmode="numeric"{*
        *}{if $field->getChunks() && $field->getChunkLength()} size="{$field->getChunks() - 1 + $field->getChunks() * $field->getChunkLength()}"{/if}{*
index 1dde538f16bcfc1af971bb45e57976ad0a187f45..8f3a61ad64324d10e5da78b9e98adb711736c420 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}{*
        *}pattern="[0-9\s]*" {*
        *}inputmode="numeric"{*
        *}{if $field->getChunks() && $field->getChunkLength()} size="{$field->getChunks() - 1 + $field->getChunks() * $field->getChunkLength()}"{/if}{*
index 1d42feee8d2e69ef5fef50afa16b123db69fc387..b025ee9ba4906918d5c2f79e3e69889573801057 100644 (file)
@@ -37,6 +37,7 @@ class CodeFormField extends TextFormField {
                $this->chunkLength(BackupMultifactorMethod::CHUNK_LENGTH);
                $this->minimumLength($this->getChunks() * $this->getChunkLength());
                $this->addFieldClass('multifactorBackupCode');
+               $this->autoComplete('off');
                
                $placeholder = '';
                $gen = Helper::digitStream();