2

To implement Content Security Policy, I need to pass a random token generated in the Document component at _document.js file to the NextApp component at the _app.js file.

I want to do that without using the request object or context. I think it should be possible because the Document component wraps the NextApp component.

Is there a clean way to send props from the Document component to the NextApp component in a clean and Next.js idiomatic way?

bman
  • 4,368
  • 3
  • 34
  • 65
  • Perhaps web storage/client side cookie? I’m not sure about the security implementations of this but [heres an extensive post](https://stackoverflow.com/a/44209185/10653440) that discusses the aforementioned. You could build a custom hook. – msalla Apr 16 '21 at 08:19

0 Answers0