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

The script doesnt work when csp is enabled #46

Open
Doekos opened this issue Apr 30, 2024 · 1 comment
Open

The script doesnt work when csp is enabled #46

Doekos opened this issue Apr 30, 2024 · 1 comment

Comments

@Doekos
Copy link

Doekos commented Apr 30, 2024

I would like to have the option to add a nonce to the script tag without having to override classes.

I've tried overriding the CookiesManager getDefaultScriptTag function to add a nonce, however for some reason I keep getting the $this->shouldDisplayNotice() as true when the Cookie is in my Storage with 'consent_at' filled.

But when I make these changes in the vendor file, it's working.

Any ideas/suggestions?

@Doekos
Copy link
Author

Doekos commented May 10, 2024

Update:

I made a workaround; I have extended the CookiesManager class and overriden the getDefaultScriptTag() function with a 'nonce="' . csp_nonce() . '" '. It would've been made easier if this was just a configuration option.

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

1 participant