@@ -61,18 +61,19 @@ const mailRoute = require('./routes/mail');
6161const healthRoute = require ( './routes/health' ) ;
6262
6363// ROUTES SETUP
64- app . use ( '/api/userAuth' , limiter , logger , userAuthRoute ) ;
65-
6664const projectCorsPreflight = ( req , res , next ) => {
6765 res . header ( "Access-Control-Allow-Origin" , req . headers . origin || "*" ) ;
6866 res . header ( "Access-Control-Allow-Methods" , "GET, POST, PUT, DELETE, OPTIONS, PATCH" ) ;
6967 res . header ( "Access-Control-Allow-Headers" , "Content-Type, Authorization, x-api-key" ) ;
68+ res . header ( "Access-Control-Allow-Credentials" , "true" ) ;
7069 if ( req . method === 'OPTIONS' ) {
7170 return res . status ( 200 ) . end ( ) ;
7271 }
7372 next ( ) ;
7473} ;
7574
75+ app . use ( '/api/userAuth' , projectCorsPreflight , limiter , logger , userAuthRoute ) ;
76+
7677app . use ( '/api/data' , projectCorsPreflight , limiter , logger , dataRoute ) ;
7778app . use ( '/api/schemas' , projectCorsPreflight , limiter , logger , schemaRoute ) ;
7879app . use ( '/api/storage' , projectCorsPreflight , limiter , logger , storageRoute ) ;
0 commit comments