public function BasicSetup::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/ BasicSetup.php, line 309
Class
- BasicSetup
- TFA setup form router.
Namespace
Drupal\tfa\FormCode
public function cancelForm(array &$form, FormStateInterface $form_state) {
$account = $form['account']['#value'];
$this
->messenger()
->addWarning($this
->t('TFA setup canceled.'));
$form_state
->setRedirect('tfa.overview', [
'user' => $account
->id(),
]);
}