You are here

function apigee_edge_form_apigee_edge_authentication_form_alter in Apigee Edge 8

Implements hook_form_FORM_ID_alter().

File

./apigee_edge.module, line 83
Copyright 2018 Google Inc.

Code

function apigee_edge_form_apigee_edge_authentication_form_alter(array &$form, FormStateInterface $form_state, string $form_id) {

  /** @var bool $do_not_alter_key_entity_forms */
  $do_not_alter_key_entity_forms = \Drupal::config('apigee_edge.dangerzone')
    ->get('do_not_alter_key_entity_forms');

  // Even if the original Key forms should not be altered, the Authentication
  // form provided by this module should still work the same.
  if ($do_not_alter_key_entity_forms) {

    /** @var \Drupal\apigee_edge\KeyEntityFormEnhancer $key_entity_form_enhancer */
    $key_entity_form_enhancer = \Drupal::service('apigee_edge.key_entity_form_enhancer');
    $key_entity_form_enhancer
      ->alterForm($form, $form_state);
  }
}