From: Steph Ponzo Date: Sat, 28 Feb 2026 20:05:05 +0000 (+0100) Subject: fix(alerts): CORS Socket.IO pour React Native X-Git-Url: https://git.digitality.be/?a=commitdiff_plain;h=397aa491a0615dfdcb947679e47f2b61f722c496;p=pdw25-26 fix(alerts): CORS Socket.IO pour React Native --- diff --git a/Wallette/server/modules/alerts/socketManager.js b/Wallette/server/modules/alerts/socketManager.js index 931ed75..4f5602e 100644 --- a/Wallette/server/modules/alerts/socketManager.js +++ b/Wallette/server/modules/alerts/socketManager.js @@ -45,9 +45,12 @@ export function initSocketIO(httpServer, options = {}) { // Configuration par défaut + options personnalisées const defaultOptions = { cors: { - origin: "*", // En prod, restreindre aux domaines autorisés - methods: ["GET", "POST"] - } + origin: "*", + methods: ["GET", "POST", "OPTIONS"], + allowedHeaders: ["Content-Type", "Authorization"], + credentials: false + }, + transports: ["polling", "websocket"] }; io = new Server(httpServer, { ...defaultOptions, ...options });