You are here

public function MobileNumberTfa::begin in Mobile Number 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/TfaValidation/MobileNumberTfa.php \Drupal\mobile_number\Plugin\TfaValidation\MobileNumberTfa::begin()

File

src/Plugin/TfaValidation/MobileNumberTfa.php, line 87
MobileNumberTfa.php

Class

MobileNumberTfa
Class MobileNumberTfa is a validation and sending plugin for TFA.

Namespace

Drupal\mobile_number\Plugin\TfaValidation

Code

public function begin() {
  if (!$this->code) {
    if (!$this
      ->sendCode()) {
      $this->messenger
        ->addError(t('Unable to deliver the code. Please contact support.'));
    }
  }
}