You are here

public function GALoginTotpValidation::validateRequest in Google Authenticator login 8

Simple validate for web services.

Parameters

int $code: OTP Code.

Return value

bool True if validation was successful otherwise false.

File

src/Plugin/TfaValidation/GALoginTotpValidation.php, line 246

Class

GALoginTotpValidation
TOTP validation class for performing TOTP validation.

Namespace

Drupal\ga_login\Plugin\TfaValidation

Code

public function validateRequest($code) {
  if ($this
    ->validate($code)) {
    $this
      ->storeAcceptedCode($code);
    return TRUE;
  }
  return FALSE;
}