glob pattern in exceptRoutes field of config/shield.ts #1399
-
Is there any way I can add a glob pattern in exceptRoutes in config/shield.ts? //config/shield.ts
exceptRoutes: ["/api/v1/**"] but it didn't work. It only worked when I write the route in full. I have quite a few routes to except because my app is both web and api server for a mobile app, and it's a pain to register all the routes individually. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Don't think so, since it uses String.includes internally with route pattern To mach all API routes you can just make it |
Beta Was this translation helpful? Give feedback.
-
Yes, currently shield allows defining exceptRoutes: (ctx) => {
// perform your check
return true // to ignore
return false // to not ignore
} |
Beta Was this translation helpful? Give feedback.
Yes, currently shield allows defining
route patterns
and notglob patterns
. I believe, I can add support for a function that must return a boolean.