My sockets work fine when the client has a token (provided by Laravel jwt), but I need to work with clients while they are not yet authenticated. I need something like:
io.sockets
.on('connection', socketioJwt.authorize({
secret: process.env.JWT_SECRET,
timeout: 15000
}))
.on('authenticated', function(socket) {
console.log('Authenticated!!');
socket.on('setDataRegistered', function(datos) {
console.log('Registering!');
});
})
.on('config', function(socket) {
console.log('A client wants to be configured before authenticated!');
})
How can I call from FrontEnd to 'config' (socket.emit ('config')) before authentication?
Thank you for your help. Sorry, my English.
source
share