public function TfaRecoveryCode::buildConfigurationForm in Two-factor Authentication (TFA) 8
Configuration form for the recovery code plugin.
Parameters
\Drupal\Core\Config\Config $config: Config object for tfa settings.
array $state: Form state array determines if this form should be shown.
Return value
array Form array specific for this validation plugin.
File
- src/
Plugin/ TfaValidation/ TfaRecoveryCode.php, line 122
Class
- TfaRecoveryCode
- Recovery validation class for performing recovery codes validation.
Namespace
Drupal\tfa\Plugin\TfaValidationCode
public function buildConfigurationForm(Config $config, array $state = []) {
$settings_form['recovery_codes_amount'] = [
'#type' => 'number',
'#title' => $this
->t('Recovery Codes Amount'),
'#default_value' => $this->codeLimit,
'#description' => $this
->t('Number of Recovery Codes To Generate.'),
'#min' => 1,
'#size' => 2,
'#states' => $state,
'#required' => TRUE,
];
return $settings_form;
}