You are here

public function PathConfigForm::buildForm in JSON Web Token Authentication (JWT) 8

Form constructor.

Parameters

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

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

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

modules/jwt_path_auth/src/Form/PathConfigForm.php, line 34

Class

PathConfigForm
Class ConfigForm.

Namespace

Drupal\jwt_path_auth\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['help'] = [
    '#markup' => $this
      ->t('Configure path prefixes where a JWT may be used in the query string to authenticate.'),
  ];
  $form['allowed_path_prefixes'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Path Prefixes'),
    '#default_value' => implode("\n", $this
      ->config('jwt_path_auth.config')
      ->get('allowed_path_prefixes')),
    '#description' => $this
      ->t('Enter one path prefix value per line.'),
  ];
  return parent::buildForm($form, $form_state);
}