Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Blitz plugin #39

Open
jorenvanhee opened this issue May 22, 2022 · 3 comments
Open

Not working with Blitz plugin #39

jorenvanhee opened this issue May 22, 2022 · 3 comments

Comments

@jorenvanhee
Copy link

I'm using CCC in combination with Blitz. Blitz requires me to use {{ craft.blitz.csrfInput() }} instead of {{ csrfInput() }}

This would be an easy fix if the templates were customisable, but I don't think this is possible right now. Is this something you could add or should I look for another solution?

@WHITE-developer
Copy link

Also, when warming the cache, Blitz adds ?token= which gets cached in the cccSiteUrl script breaking all action urls.

@nilsenpaul
Copy link
Owner

As of version 1.1.1, params do not get included in cccSiteUrl anymore. As for Blitz, we're still trying to come up with the best way to get this done.

@jorenvanhee
Copy link
Author

I fixed it for now by adding this to config/general.php:

$action = $_REQUEST['action'] ?? '';

return [
    // ...

    'enableCsrfProtection' => $action === 'complete-cookie-consent/consent/submit' ? false : true,
]

Not sure if this will work for everybody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants