The changes allow you to pass a csp_nonce_assign_key as an option into the plug and it uses that to pull a nonce from the conn.assigns to add a nonce attribute to the script and link tags.
This is my first hack at it but it seems to resolve the CSP related errors that I was experiencing. Open to suggestions for improvement.
One note: I'm experiencing a JS error on the advanced GraphiQL interface but I'm also experiencing the same error when I run against the current main branch in this repo. Not exactly sure what is going on there but it doesn't seem as though my changes are the cause.
The changes allow you to pass a
csp_nonce_assign_key
as an option into the plug and it uses that to pull a nonce from theconn.assigns
to add a nonce attribute to the script and link tags.This is my first hack at it but it seems to resolve the CSP related errors that I was experiencing. Open to suggestions for improvement.
One note: I'm experiencing a JS error on the advanced GraphiQL interface but I'm also experiencing the same error when I run against the current main branch in this repo. Not exactly sure what is going on there but it doesn't seem as though my changes are the cause.