public function N1EDController::setApiKey in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2
Sets API key into Drupal config.
1 string reference to 'N1EDController::setApiKey'
File
- src/
Controller/ N1EDController.php, line 52
Class
- N1EDController
- Provides route responses for Flmngr file manager.
Namespace
Drupal\n1ed\ControllerCode
public function setApiKey() {
$apiKey = $this->requestStack
->getCurrentRequest()->request
->get("n1edApiKey");
$token = $this->requestStack
->getCurrentRequest()->request
->get("n1edToken");
if ($apiKey == NULL || $token == NULL) {
throw new AccessDeniedHttpException();
}
$config = $this->configFactory
->getEditable('n1ed.settings');
$config
->set('apikey', $apiKey);
$config
->set('token', $token);
$config
->save(TRUE);
return new Response();
}