Feature(s) impacted
Action
Observed behavior
Upon Action, on development, I’m getting a Cors problem
Expected behavior
After upgrading to v8 all is goo in the READ operation, but the Action is returning the CORS problem on development. this is my current cors configurations :
app.use(express.json({
limit: '50mb'
}))
app.use(express.urlencoded({
extended: false,
limit: '50mb'
}))
app.use(cookieParser())
app.use(express.static(path.join(__dirname, '..', 'public')))
let allowedOrigins = ['*.forestadmin.com', '*.run.app'];
const corsConfig = {
origin: allowedOrigins,
allowedHeaders: ['Forest-Context-Url', 'Authorization', 'X-Requested-With', 'Content-Type'],
maxAge: 86400, // NOTICE: 1 day
credentials: true,
};
app.use('/forest/authentication', cors({
...corsConfig,
origin: corsConfig.origin.concat('null')
}));
app.use(cors(corsConfig));
app.use(jwt({
secret: process.env.FOREST_AUTH_SECRET,
credentialsRequired: false,
algorithms: ['HS256']
}))
Failure Logs
Access to fetch at 'http://localhost:3000/forest/actions/actiona-name?timezone=Europe%2F' from origin 'https://app.forestadmin.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Knowing that it was working fine before doing the upgrade, m’i missing anything?
Console log :
info : OPTIONS /forest/actions/action-route/action-name?timezone=Europe%2F 200 4 - 57.825 ms
Context
I can share all the needed information in Private due to project requirements.
"forest-express-sequelize": "^8.4.7",
"express": "~4.17.1"