You are here

public function Oauth2GenerateKey::generateKeysModalAjaxResponse in Simple OAuth (OAuth2) & OpenID Connect 8.3

Same name and namespace in other branches
  1. 8.4 src/Controller/Oauth2GenerateKey.php \Drupal\simple_oauth\Controller\Oauth2GenerateKey::generateKeysModalAjaxResponse()
  2. 5.x src/Controller/Oauth2GenerateKey.php \Drupal\simple_oauth\Controller\Oauth2GenerateKey::generateKeysModalAjaxResponse()
1 string reference to 'Oauth2GenerateKey::generateKeysModalAjaxResponse'
simple_oauth.routing.yml in ./simple_oauth.routing.yml
simple_oauth.routing.yml

File

src/Controller/Oauth2GenerateKey.php, line 42

Class

Oauth2GenerateKey
@internal

Namespace

Drupal\simple_oauth\Controller

Code

public function generateKeysModalAjaxResponse(Request $request) {
  $response = new AjaxResponse();
  $modal_form = call_user_func_array([
    $this->formBuilder,
    'getForm',
  ], [
    Oauth2GenerateKeyForm::class,
    $request->query
      ->get('pubk_id'),
    $request->query
      ->get('pk_id'),
  ]);
  $response
    ->addCommand(new OpenModalDialogCommand('Generate Keys', $modal_form, [
    'width' => 'auto',
  ]));
  $response
    ->addCommand(new InvokeCommand('#key-error-message', 'hide'));
  return $response;
}