You are here

public function TfaLoginForm::buildForm in Two-factor Authentication (TFA) 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides UserLoginForm::buildForm

File

src/Form/TfaLoginForm.php, line 122

Class

TfaLoginForm
TFA user login form.

Namespace

Drupal\tfa\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $form['#submit'][] = '::tfaLoginFormRedirect';
  $form['#cache'] = [
    'max-age' => 0,
  ];
  return $form;
}