-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Hey! My old project used io.socket.get to connect to secret rooms.
io.socket.get('/list/handshake', function (data, jwr) {
if (jwr.error) {
return;
}
});
io.socket.get('/terminal/handshake', function (data, jwr) {
if (jwr.error) {
return;
}
});
After auditing the packages, I received updates and am now getting a 401 error when trying to connect.
I'm assuming that it's necessary to pass cookie bitches and the io.socket.request method is more suitable for this, but I have a poor idea of what exactly the sails require to pass the request authorization. Who faced a similar problem and what solution can work?
io.socket.request({
method: 'get',
url: '/list/handshake',
headers: {
// cookie: document.cookie,
'x-csrf-token': window.SAILS_LOCALS._csrf ? window.SAILS_LOCALS._csrf : '',
}
}, function (data, jwr) {
if (jwr.error) {
return;
}
});
io.socket.request({
method: 'get',
url: '/terminal/handshake',
}, function (data, jwr) {
if (jwr.error) {
return;
}
});