From 397aa491a0615dfdcb947679e47f2b61f722c496 Mon Sep 17 00:00:00 2001 From: Steph Ponzo Date: Sat, 28 Feb 2026 21:05:05 +0100 Subject: [PATCH] fix(alerts): CORS Socket.IO pour React Native --- Wallette/server/modules/alerts/socketManager.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 }); -- 2.50.1