You are here

function MoAuthCustomerSetup::mo_auth_back in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/Form/MoAuthCustomerSetup.php \Drupal\miniorange_2fa\Form\MoAuthCustomerSetup::mo_auth_back()

Handle back button submit for customer setup.

File

src/Form/MoAuthCustomerSetup.php, line 438
Contains form for customer setup.

Class

MoAuthCustomerSetup
Customer setup form().

Namespace

Drupal\miniorange_2fa\Form

Code

function mo_auth_back($form, &$form_state) {
  \Drupal::configFactory()
    ->getEditable('miniorange_2fa.settings')
    ->set('mo_auth_status', 'CUSTOMER_SETUP')
    ->save();
  \Drupal::configFactory()
    ->getEditable('miniorange_2fa.settings')
    ->clear('mo_auth_customer_admin_email')
    ->save();
  \Drupal::configFactory()
    ->getEditable('miniorange_2fa.settings')
    ->clear('mo_auth_customer_admin_phone')
    ->save();
  \Drupal::configFactory()
    ->getEditable('miniorange_2fa.settings')
    ->clear('mo_auth_tx_id')
    ->save();
  \Drupal::messenger()
    ->addMessage(t('Register/Login with your miniOrange Account'));
}