public function RequestSubscriber::onRequest in Lightning API 8
Same name and namespace in other branches
- 8.4 src/RequestSubscriber.php \Drupal\lightning_api\RequestSubscriber::onRequest()
- 8.2 src/RequestSubscriber.php \Drupal\lightning_api\RequestSubscriber::onRequest()
- 8.3 src/RequestSubscriber.php \Drupal\lightning_api\RequestSubscriber::onRequest()
File
- src/
RequestSubscriber.php, line 53
Class
Namespace
Drupal\lightning_apiCode
public function onRequest() {
if ($this->routeMatch
->getRouteName() == 'oauth2_token.settings' && $this->key
->exists() == FALSE) {
$url = Url::fromRoute('lightning_api.generate_keys');
drupal_set_message($this
->t('You may wish to <a href=":generate_keys">generate a key pair</a> for OAuth authentication.', [
':generate_keys' => $url
->toString(),
]), 'warning');
}
}