Closed piperun closed 2 months ago
Hey @piperun did you get it to work with %sveltekit.nonce%
? As far as I know you can use csp here as long as you aren't prerendering that page
I went the "lazy" route and copy-pasted the hash the error message gives, so I assume in my case it is prerendering, or maybe I'm missing something (haven't really touched upon csp so I can only more or less quote the svelte doc about CSP).
I think using hash here might cause it to break when the turnstile script updates but I am not 100% sure without looking into it. I'm not sure if we can conditionally add a %sveltekit.nonce% but it might be worth a try, thought it will only work when people use SvelteKit and don't prerender that page
Even though it would be very useful!
Gonna go ahead and close this for now as it's not something we could really support unless turnstile provides a way :/
From testing things out with: svelte.config.js:
It seems that it'll still refuse to run 1 script and 1 worker:
Now if I understand it correctly adding:
nonce="%sveltekit.nonce%"
like this:Should make it work, but I'll admit I'm no expert at CSP.