You are here

function miniorange_2fa_inline_registration::handle_page_cancel in Google Authenticator / 2 Factor Authentication - 2FA 8.2

Same name and namespace in other branches
  1. 8 src/Form/miniorange_2fa_inline_registration.php \Drupal\miniorange_2fa\form\miniorange_2fa_inline_registration::handle_page_cancel()

File

src/Form/miniorange_2fa_inline_registration.php, line 1553
Page 1: Select Email address. Page 2: Verify OTP. Page 3: Select Auth Method. Page 4: Configure Auth Method. Page 5: Configure KBA.

Class

miniorange_2fa_inline_registration
@file Page 1: Select Email address. Page 2: Verify OTP. Page 3: Select Auth Method. Page 4: Configure Auth Method. Page 5: Configure KBA.

Namespace

Drupal\miniorange_2fa\form

Code

function handle_page_cancel() {
  $session = MoAuthUtilities::getSession();
  $session
    ->set('mo_auth', array());
  $session
    ->save();
  unset($_SESSION['message']);
  $_SESSION['success_status'] = TRUE;
  $url = Url::fromRoute('user.login')
    ->toString();
  $response = new RedirectResponse($url);
  $response
    ->send();
}