You are here

public function Oauth2TokenSettingsForm::submitForm in Simple OAuth (OAuth2) & OpenID Connect 8.3

Same name and namespace in other branches
  1. 8.4 src/Entity/Form/Oauth2TokenSettingsForm.php \Drupal\simple_oauth\Entity\Form\Oauth2TokenSettingsForm::submitForm()
  2. 8.2 src/Entity/Form/Oauth2TokenSettingsForm.php \Drupal\simple_oauth\Entity\Form\Oauth2TokenSettingsForm::submitForm()
  3. 5.x src/Entity/Form/Oauth2TokenSettingsForm.php \Drupal\simple_oauth\Entity\Form\Oauth2TokenSettingsForm::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/Entity/Form/Oauth2TokenSettingsForm.php, line 92

Class

Oauth2TokenSettingsForm
The settings form.

Namespace

Drupal\simple_oauth\Entity\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $settings = $this
    ->config('simple_oauth.settings');
  $settings
    ->set('access_token_expiration', $form_state
    ->getValue('access_token_expiration'));
  $settings
    ->set('refresh_token_expiration', $form_state
    ->getValue('refresh_token_expiration'));
  $settings
    ->set('token_cron_batch_size', $form_state
    ->getValue('token_cron_batch_size'));
  $settings
    ->set('public_key', $form_state
    ->getValue('public_key'));
  $settings
    ->set('private_key', $form_state
    ->getValue('private_key'));
  $settings
    ->set('remember_clients', $form_state
    ->getValue('remember_clients'));
  $settings
    ->save();
  parent::submitForm($form, $form_state);
}