public function ConfigForm::validateForm in Auto Login URL 8
Same name and namespace in other branches
- 2.x src/Form/ConfigForm.php \Drupal\auto_login_url\Form\ConfigForm::validateForm()
Implements \Drupal\Core\Form\FormInterface::validateForm().
Overrides FormBase::validateForm
File
- src/
Form/ ConfigForm.php, line 66
Class
Namespace
Drupal\auto_login_url\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
if ($form_state
->getValue('auto_login_url_expiration') < 1) {
$form_state
->setErrorByName('auto_login_url_expiration', $this
->t('Expiration must be positive integer.'));
}
if ($form_state
->getValue('auto_login_url_token_length') < 8 || $form_state
->getValue('auto_login_url_token_length') > 64) {
$form_state
->setErrorByName('auto_login_url_token_length', $this
->t('Token length has to be between 6 and 64 digits.'));
}
}