You are here

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

Whether login is allowed.

Return value

bool Whether login is allowed.

Overrides TfaLoginInterface::loginAllowed

File

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

Class

TfaTrustedBrowser
Trusted browser validation class.

Namespace

Drupal\tfa\Plugin\TfaLogin

Code

public function loginAllowed() {
  if (isset($_COOKIE[$this->cookieName]) && $this
    ->trustedBrowser($_COOKIE[$this->cookieName]) !== FALSE) {
    $this
      ->setUsed($_COOKIE[$this->cookieName]);
    return TRUE;
  }
  return FALSE;
}