public function GALoginHotpSetup::validateSetupForm in Google Authenticator login 8
Validate the setup data.
Parameters
array $form: The configuration form array.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
bool Whether or not form passes validation.
Overrides TfaSetupInterface::validateSetupForm
File
- src/
Plugin/ TfaSetup/ GALoginHotpSetup.php, line 113
Class
- GALoginHotpSetup
- HOTP setup class to setup HOTP validation.
Namespace
Drupal\ga_login\Plugin\TfaSetupCode
public function validateSetupForm(array $form, FormStateInterface $form_state) {
if (!$this
->validate($form_state
->getValue('code'))) {
$this->errorMessages['code'] = $this
->t('Invalid application code. Please try again.');
return FALSE;
}
$this
->storeAcceptedCode($form_state
->getValue('code'));
return TRUE;
}