From 0bc670974fa323824c8e5790ea458e38c6c42aec Mon Sep 17 00:00:00 2001 From: Dominic Tubach Date: Fri, 9 Aug 2024 14:40:22 +0200 Subject: [PATCH] Don't limit access to route `civiremote_entity.remote_page_get` --- modules/civiremote_entity/civiremote_entity.routing.yml | 2 +- .../civiremote_entity/src/CiviCRMPage/CiviCRMPageClient.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/civiremote_entity/civiremote_entity.routing.yml b/modules/civiremote_entity/civiremote_entity.routing.yml index 32c3482..64674de 100644 --- a/modules/civiremote_entity/civiremote_entity.routing.yml +++ b/modules/civiremote_entity/civiremote_entity.routing.yml @@ -13,4 +13,4 @@ civiremote_entity.remote_page_get: filename: type: string requirements: - _user_is_logged_in: 'TRUE' + _access: 'TRUE' diff --git a/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageClient.php b/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageClient.php index 8abee73..f10be8f 100644 --- a/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageClient.php +++ b/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageClient.php @@ -87,14 +87,13 @@ public function request(string $method, string $uri, array $options = []): Respo } /** - * @phpstan-return array + * @phpstan-return array */ private function buildHeaders(): array { return [ 'X-Civi-Auth' => 'Bearer ' . $this->apiKey, 'X-Civi-Key' => $this->siteKey, - 'X-Civi-Remote-Contact-Id' => $this->remoteContactIdProvider->hasRemoteContactId() - ? $this->remoteContactIdProvider->getRemoteContactId() : '', + 'X-Civi-Remote-Contact-Id' => $this->remoteContactIdProvider->getRemoteContactIdOrNull() ?? '', ]; }