Why is `req.user` undefined for socket requests in Sails.js, Angular.js and Passport.js?
问题 I am trying to get the questions for the current user with a request like this: http://localhost:1337/question/forme As part of the GET request, I am able to access req.user.username and serve the JSONresponse when accessing it from the browser. When I try to make the same Socket.get() request from my Angular client.js file, it doesn't work. I also tried to access it using browser console and it fails for socket.get() requests. 回答1: I spent a large time figuring out all the moving parts to