public function Oauth2AuthorizeForm::submitForm in Simple OAuth (OAuth2) & OpenID Connect 8.4
Same name and namespace in other branches
- 5.x src/Controller/Oauth2AuthorizeForm.php \Drupal\simple_oauth\Controller\Oauth2AuthorizeForm::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/
Controller/ Oauth2AuthorizeForm.php, line 227
Class
- Oauth2AuthorizeForm
- Authorize form.
Namespace
Drupal\simple_oauth\ControllerCode
public function submitForm(array &$form, FormStateInterface $form_state) {
if ($auth_request = $form_state
->get('auth_request')) {
$can_grant_codes = $this
->currentUser()
->hasPermission('grant simple_oauth codes');
$redirect_response = Oauth2AuthorizeController::redirectToCallback($auth_request, $this->server, $this
->currentUser(), (bool) $form_state
->getValue('submit') && $can_grant_codes, (bool) $this->configFactory
->get('simple_oauth.settings')
->get('remember_clients'), $this->knownClientRepository);
$form_state
->setResponse($redirect_response);
}
}