You are here

public function GALoginHotpValidation::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/GALoginHotpValidation.php, line 242

Class

GALoginHotpValidation
HOTP validation class for performing HOTP validation.

Namespace

Drupal\ga_login\Plugin\TfaValidation

Code

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