Authenticate users in Node using JWT and Laravel
Stefan Doorn
1108

Hi Stefan, thanks for the tutorial. I’ve implemented each part as you describe, but I’m having trouble with this part of the client-side JS:

socket.on(‘connect’, function () {
 connectionUpdate(‘Connected to SocketIO, Authenticating’)
 socket.emit(‘authenticate’, {token: result.token});
 });

When I load the page, I get to that step but then nothing happens as there’s nothing listening for the ‘authenticate’ event. So my screen displays ‘Connected to SocketIO, Authenticating’ and just freezes there. Any idea what I’m missing? Cheers!