You are here

public function BasicSettingsForm::submitForm in Auth0 Single Sign On 8

Same name and namespace in other branches
  1. 8.2 src/Form/BasicSettingsForm.php \Drupal\auth0\Form\BasicSettingsForm::submitForm()

Form submission 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 FormInterface::submitForm

File

src/Form/BasicSettingsForm.php, line 104
Contains \Drupal\auth0\Form\BasicSettingsForm.

Class

BasicSettingsForm
This forms handles the basic module configurations.

Namespace

Drupal\auth0\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = \Drupal::service('config.factory')
    ->getEditable('auth0.settings');
  $config
    ->set('auth0_client_id', $form_state
    ->getValue('auth0_client_id'))
    ->set('auth0_client_secret', $form_state
    ->getValue('auth0_client_secret'))
    ->set('auth0_domain', $form_state
    ->getValue('auth0_domain'))
    ->set('auth0_jwt_signature_alg', $form_state
    ->getValue('auth0_jwt_signature_alg'))
    ->set('auth0_secret_base64_encoded', $form_state
    ->getValue('auth0_secret_base64_encoded'))
    ->save();
}