From fa1dbc261105cda2edfdf2118611df7a2021ca06 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 9 Jun 2022 10:24:03 -0700 Subject: [PATCH] Add back cookie support for CORS and WS. --- client/src/pages/dms/dms.container.jsx | 1 + server.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/pages/dms/dms.container.jsx b/client/src/pages/dms/dms.container.jsx index 9d957c7b9..a2e98f5f4 100644 --- a/client/src/pages/dms/dms.container.jsx +++ b/client/src/pages/dms/dms.container.jsx @@ -48,6 +48,7 @@ export const socket = SocketIO( : window.location.origin, { path: "/ws", + withCredentials: true, auth: async (callback) => { const token = auth.currentUser && (await auth.currentUser.getIdToken()); callback({ token }); diff --git a/server.js b/server.js index 952d1cc67..d3b809531 100644 --- a/server.js +++ b/server.js @@ -36,6 +36,7 @@ const io = new Server(server, { "https://www.imex.online", ], methods: ["GET", "POST"], + credentials: true, }, }); exports.io = io; @@ -48,7 +49,7 @@ app.use(bodyParser.json({ limit: "50mb" })); app.use(bodyParser.urlencoded({ limit: "50mb", extended: true })); //app.use(enforce.HTTPS({ trustProtoHeader: true })); app.use( - cors() + cors({ credentials: true }) // cors({ // credentials: true, // origin: [