@@ -31,14 +31,29 @@ const allowedOrigins = [env.ALLOWED_ORIGIN_1, env.ALLOWED_ORIGIN_2].filter(
3131) ;
3232
3333// Security middleware configurations
34- export const apiSecurity = createApiSecurity ( allowedOrigins , logger ) ;
34+ // For development, create a no-op middleware to disable CSP
35+ export const apiSecurity =
36+ process . env . NODE_ENV === 'development'
37+ ? ( req : any , res : any , next : any ) => {
38+ // Skip API security in development to avoid CSP issues
39+ next ( ) ;
40+ }
41+ : createApiSecurity ( allowedOrigins , logger ) ;
3542export const authSecurity = createAuthSecurity ( allowedOrigins , logger ) ;
3643export const formSecurity = createFormSecurity ( allowedOrigins , logger ) ;
3744export const passwordResetSecurity = createPasswordResetSecurity (
3845 allowedOrigins ,
3946 logger
4047) ;
41- export const staticSecurity = createStaticSecurity ( ) ;
48+ // For development, we'll disable CSP entirely to allow inline scripts
49+ // In production, use the default secure CSP
50+ export const staticSecurity =
51+ process . env . NODE_ENV === 'development'
52+ ? ( req : any , res : any , next : any ) => {
53+ // Skip CSP in development
54+ next ( ) ;
55+ }
56+ : createStaticSecurity ( ) ;
4257
4358// API security middleware
4459export const validateApiKey = createValidateApiKey ( logger ) ;
0 commit comments