public function ConfigForm::submitForm in JSON Web Token Authentication (JWT) 8
Same name and namespace in other branches
- 8.0 src/Form/ConfigForm.php \Drupal\jwt\Form\ConfigForm::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/ ConfigForm.php, line 170
Class
- ConfigForm
- Class ConfigForm.
Namespace
Drupal\jwt\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$values = $form_state
->getValues();
if (isset($values['jwt_algorithm'])) {
$this
->config('jwt.config')
->set('algorithm', $values['jwt_algorithm'])
->save();
}
if (isset($values['jwt_key'])) {
$this
->config('jwt.config')
->set('key_id', $values['jwt_key'])
->save();
}
}