vuetify-nuxt-module icon indicating copy to clipboard operation
vuetify-nuxt-module copied to clipboard

Feature Request: support nuxt-security csp dynamically

Open zakarialounes opened this issue 10 months ago • 0 comments

Currently it is only possible to set a csp nonce via theme.cspNonce configuration object (will therefore be static). This should be possible dynamically.

useTheme() via the global property already allows changing the theme, it would be useful to be able to set/change the nonce in the same way. It will probably be necessary to add a vuetify nitro hook in order to allow us to change the csp token before rendering?

For reference:

// change theme 
const vuetifyTheme = useTheme()
const changeTheme = () => {
  vuetifyTheme.global.name.value = getNextThemeName()
};
  • https://github.com/nuxt-modules/security/issues/239#issuecomment-1755706459

zakarialounes avatar Nov 28 '24 17:11 zakarialounes