diff --git a/Classes/Controller/ApiController.php b/Classes/Controller/ApiController.php index 6ba60c5..3735df1 100644 --- a/Classes/Controller/ApiController.php +++ b/Classes/Controller/ApiController.php @@ -7,6 +7,7 @@ use Neos\ContentRepository\Domain\Model\NodeInterface; use Neos\ContentRepository\Domain\Service\ContextFactoryInterface; use Neos\Eel\FlowQuery\FlowQuery; +use Neos\Flow\Http\Component\SetHeaderComponent; use Neos\Flow\Mvc\Controller\RestController; use Neos\Flow\Mvc\View\JsonView; use Neos\Neos\View\FusionView; @@ -38,11 +39,11 @@ class ApiController extends RestController public function initializeAction() { parent::initializeAction(); - $this->response->setHeader('Access-Control-Allow-Origin', $this->request->getHttpRequest()->getHeader('Origin')); - $this->response->setHeader('Access-Control-Allow-Headers', 'Content-Type, Cookie, credentials'); - $this->response->setHeader('Access-Control-Allow-Credentials', 'true'); - $this->response->setHeader('Vary', 'Origin'); + //TODO: Make CORS configurable in settings + //$this->response->setComponentParameter(SetHeaderComponent::class, 'Access-Control-Allow-Origin', $this->request->getHttpRequest()->getHeader('Referer')); + //$this->response->setComponentParameter(SetHeaderComponent::class, 'Access-Control-Allow-Credentials', 'true'); + $this->response->setComponentParameter(SetHeaderComponent::class, 'Vary', 'Origin'); } diff --git a/Resources/Private/Fusion/NodeTypes/Content.CookieSettings.fusion b/Resources/Private/Fusion/NodeTypes/Content.CookieSettings.fusion index ec3f711..b8f632e 100644 --- a/Resources/Private/Fusion/NodeTypes/Content.CookieSettings.fusion +++ b/Resources/Private/Fusion/NodeTypes/Content.CookieSettings.fusion @@ -39,7 +39,7 @@ prototype(KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings) < prototype renderer = KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings.Renderer @cache { - mode = 'dynamic' + mode = 'uncached' context { 1 = 'node' @@ -47,15 +47,6 @@ prototype(KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings) < prototype 3 = 'site' 4 = 'cookieValue' } - entryIdentifier { - node = ${node} - } - entryDiscriminator = ${(cookieValue) && (q(node).property('versionDate').timestamp >= Date.create(Json.parse(cookieValue).consentDate).timestamp)} - entryTags { - 1 = ${Neos.Caching.descendantOfTag(node)} - 2 = ${Neos.Caching.nodeTag(node)} - } - } } diff --git a/Resources/Private/Fusion/Root.fusion b/Resources/Private/Fusion/Root.fusion index 12a2636..ba311f8 100644 --- a/Resources/Private/Fusion/Root.fusion +++ b/Resources/Private/Fusion/Root.fusion @@ -52,7 +52,6 @@ prototype(Neos.Neos:Page) { @position = 'before closingBodyTag' } - } cookieConsentSettings = KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings