I have implemented an AngularJS application, communicate with the Sails backend via websockets using sails.io.js.
Since the backend is basically a pure API and will be connected to other applications, I am trying to completely disconnect sessions and use JWT.
I installed express-jwt and I can use normal HTTP requests pretty well, but when I send the request through sails.io.js nothing happens at all - the websocket request remains on the client, and nothing happens on the server (with "stupid" log level).
I tried the sails.io.js patch to support the parameter, and when I connect, I send a token from Angular, but in the best case, I get a response with an error message coming from express-jwt saying that there are no credentials ...
I also noticed some hints that socket.js in sails needs to be changed using beforeConnect, I saw socketio-jwt , but I have no idea where and how to connect it in Sails.
Has anyone implemented this and is using JWT with Sails and sockets? I would appreciate any hint in which direction to go :)
source share