You are here

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

Same name and namespace in other branches
  1. 8 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 ConfigFormBase::submitForm

File

src/Form/BasicSettingsForm.php, line 129
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 = $this
    ->configFactory()
    ->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_custom_domain', $form_state
    ->getValue('auth0_custom_domain'))
    ->set(AuthHelper::AUTH0_JWT_SIGNING_ALGORITHM, $form_state
    ->getValue(AuthHelper::AUTH0_JWT_SIGNING_ALGORITHM))
    ->set('auth0_secret_base64_encoded', $form_state
    ->getValue('auth0_secret_base64_encoded'))
    ->save();
  $this
    ->messenger()
    ->addStatus($this
    ->t('Saved!'));
}