diff --git a/src/defaults.ts b/src/defaults.ts index 78bbbb87..8deb7b8b 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -14,8 +14,7 @@ export const getDefaultUiConfig = (colors?: string[], csp?: { nonce?: string }) }, [...(colors || []), 'neutral' as any]), icons, csp: csp || { - nonce: '', - scriptNonce: '' + nonce: '' } }) @@ -28,8 +27,7 @@ export const defaultOptions = { transitions: true }, csp: { - nonce: '', - scriptNonce: '' + nonce: '' } } diff --git a/src/module.ts b/src/module.ts index bcf718dd..e49b5162 100644 --- a/src/module.ts +++ b/src/module.ts @@ -39,12 +39,6 @@ export interface ModuleOptions { * @defaultValue `` */ nonce?: string - - /** - * Enable nonce for inline scripts. - * @defaultValue `` - */ - scriptNonce?: string } /** diff --git a/src/runtime/plugins/colors.ts b/src/runtime/plugins/colors.ts index 9a2297df..0de2b390 100644 --- a/src/runtime/plugins/colors.ts +++ b/src/runtime/plugins/colors.ts @@ -24,7 +24,7 @@ export default defineNuxtPlugin(() => { const nuxtApp = useNuxtApp() const nonce = computed(() => appConfig.ui?.csp?.nonce) - const scriptNonce = computed(() => appConfig.ui?.csp?.scriptNonce) + const root = computed(() => { const { neutral, ...colors } = appConfig.ui.colors @@ -65,7 +65,7 @@ export default defineNuxtPlugin(() => { headData.script = [{ innerHTML: 'document.head.removeChild(document.querySelector(\'[data-nuxt-ui-colors]\'))', - ...(scriptNonce.value ? { nonce: scriptNonce.value } : {}) + ...(nonce.value ? { nonce: nonce.value } : {}) }] } diff --git a/src/templates.ts b/src/templates.ts index 111501ed..c319ce76 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -167,7 +167,6 @@ type AppConfigUI = { tv?: typeof defaultConfig csp?: { nonce?: string - scriptNonce?: string } } & TVConfig