Add back cookie support for CORS and WS.
This commit is contained in:
@@ -48,6 +48,7 @@ export const socket = SocketIO(
|
|||||||
: window.location.origin,
|
: window.location.origin,
|
||||||
{
|
{
|
||||||
path: "/ws",
|
path: "/ws",
|
||||||
|
withCredentials: true,
|
||||||
auth: async (callback) => {
|
auth: async (callback) => {
|
||||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||||
callback({ token });
|
callback({ token });
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const io = new Server(server, {
|
|||||||
"https://www.imex.online",
|
"https://www.imex.online",
|
||||||
],
|
],
|
||||||
methods: ["GET", "POST"],
|
methods: ["GET", "POST"],
|
||||||
|
credentials: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
exports.io = io;
|
exports.io = io;
|
||||||
@@ -48,7 +49,7 @@ app.use(bodyParser.json({ limit: "50mb" }));
|
|||||||
app.use(bodyParser.urlencoded({ limit: "50mb", extended: true }));
|
app.use(bodyParser.urlencoded({ limit: "50mb", extended: true }));
|
||||||
//app.use(enforce.HTTPS({ trustProtoHeader: true }));
|
//app.use(enforce.HTTPS({ trustProtoHeader: true }));
|
||||||
app.use(
|
app.use(
|
||||||
cors()
|
cors({ credentials: true })
|
||||||
// cors({
|
// cors({
|
||||||
// credentials: true,
|
// credentials: true,
|
||||||
// origin: [
|
// origin: [
|
||||||
|
|||||||
Reference in New Issue
Block a user