Files
api.portfolio/config/shield.js
2026-02-25 00:34:39 +01:00

30 lines
727 B
JavaScript

import { defineConfig } from '@adonisjs/shield';
const shieldConfig = defineConfig({
csp: {
enabled: false,
directives: {},
reportOnly: false,
},
csrf: {
enabled: true,
exceptRoutes: (ctx) => {
const p = ctx.route?.pattern ?? '';
return p.startsWith('/api') || p.startsWith('/admin');
},
enableXsrfCookie: false,
methods: ['POST', 'PUT', 'PATCH', 'DELETE'],
},
xFrame: {
enabled: true,
action: 'DENY',
},
hsts: {
enabled: true,
maxAge: '180 days',
},
contentTypeSniffing: {
enabled: true,
},
});
export default shieldConfig;
//# sourceMappingURL=shield.js.map