Skip to content

Commit 63210ec

Browse files
authored
feat: support nuxt-csurf with zero-config (#256)
1 parent 18b0ab0 commit 63210ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/features.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ export function setupBase(nuxt: Nuxt, hub: HubConfig) {
5050
if (nuxt.options.dev) {
5151
addDevToolsCustomTabs(nuxt, hub)
5252
}
53+
54+
// Add routeRules to work with some security modules
55+
nuxt.options.routeRules = nuxt.options.routeRules || {}
56+
nuxt.options.routeRules['/api/_hub/**'] = nuxt.options.routeRules['/api/_hub/**'] || {}
57+
// @ts-expect-error csurf is not typed here
58+
nuxt.options.routeRules['/api/_hub/**'].csurf = false
5359
}
5460

5561
export async function setupAI(nuxt: Nuxt, hub: HubConfig) {

0 commit comments

Comments
 (0)