You are here

public function BasicDisable::cancelForm in Two-factor Authentication (TFA) 8

Form cancel handler.

Parameters

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

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

File

src/Form/BasicDisable.php, line 215

Class

BasicDisable
TFA disable form router.

Namespace

Drupal\tfa\Form

Code

public function cancelForm(array &$form, FormStateInterface $form_state) {
  $this
    ->messenger()
    ->addWarning($this
    ->t('TFA Disable cancelled.'));
  $form_state
    ->setRedirect('tfa.overview', [
    'user' => $this
      ->currentUser()
      ->id(),
  ]);
}