You are here

public function TfaRecoveryCodeSetup::validateSetupForm in Two-factor Authentication (TFA) 8

Validate the setup data.

Parameters

array $form: The configuration form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

bool Whether or not form passes validation.

Overrides TfaSetupInterface::validateSetupForm

File

src/Plugin/TfaSetup/TfaRecoveryCodeSetup.php, line 134

Class

TfaRecoveryCodeSetup
TFA Recovery Code Setup Plugin.

Namespace

Drupal\tfa\Plugin\TfaSetup

Code

public function validateSetupForm(array $form, FormStateInterface $form_state) {
  if (!empty($form_state
    ->getValue('recovery_codes'))) {
    return TRUE;
  }
  return FALSE;
}