You are here

public function TfaTrustedBrowser::submitForm in Two-factor Authentication (TFA) 8

Submit form.

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

bool Whether plugin form handling is complete. Plugins should return FALSE to invoke multi-step.

Overrides TfaBasePlugin::submitForm

File

src/Plugin/TfaLogin/TfaTrustedBrowser.php, line 92

Class

TfaTrustedBrowser
Trusted browser validation class.

Namespace

Drupal\tfa\Plugin\TfaLogin

Code

public function submitForm(array $form, FormStateInterface &$form_state) {
  $trust_browser = $form_state
    ->getValue('trust_browser');
  if (!empty($trust_browser)) {
    $this
      ->setTrusted($this
      ->generateBrowserId(), $this
      ->getAgent());
  }
}