You are here

function miniorange_2fa_inline_registration::validate_otp_for_user in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/Form/miniorange_2fa_inline_registration.php \Drupal\miniorange_2fa\form\miniorange_2fa_inline_registration::validate_otp_for_user()
2 calls to miniorange_2fa_inline_registration::validate_otp_for_user()
miniorange_2fa_inline_registration::handle_page_otp_validate_submit in src/Form/miniorange_2fa_inline_registration.php
miniorange_2fa_inline_registration::handle_page_two_submit in src/Form/miniorange_2fa_inline_registration.php

File

src/Form/miniorange_2fa_inline_registration.php, line 762

Class

miniorange_2fa_inline_registration

Namespace

Drupal\miniorange_2fa\form

Code

function validate_otp_for_user($txId, $token) {
  $customer = new MiniorangeCustomerProfile();
  $miniorange_user = new MiniorangeUser($customer
    ->getCustomerID(), NULL, NULL, NULL, NULL);
  $auth_api_handler = new AuthenticationAPIHandler($customer
    ->getCustomerID(), $customer
    ->getAPIKey());
  $response = $auth_api_handler
    ->validate($miniorange_user, $txId, $token);
  return $response;
}