You are here

public function MiniorangeConfigOAuthClient::validateForm in Drupal OAuth & OpenID Connect Login - OAuth2 Client SSO Login 8

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

src/Form/MiniorangeConfigOAuthClient.php, line 399
Contains \Drupal\miniorange_oauth_client\Form\MiniorangeConfigOAuthClient.

Class

MiniorangeConfigOAuthClient

Namespace

Drupal\miniorange_oauth_client\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $enable_with_header = $form['markup_top_vt_start1']['miniorange_oauth_send_with_header_oauth']['#value'];
  $enable_with_body = $form['markup_top_vt_start1']['miniorange_oauth_send_with_body_oauth']['#value'];
  if ($enable_with_header == 0 && $enable_with_body == 0) {
    $form_state
      ->setErrorByName('miniorange_oauth_client', t('This state is not allowed. Please select at least one of the options to send Client ID and Secret.'));
  }
}