When I use Sails.js with Passport.js, the isAuthenticated method does not exist on the req object when requested through websocket.
Could anyone tell me why this hap
Another way to extend socket.io req with the passport defined methods login, logout, ... is to rewrite the policy or middleware as below
module.exports = (req, res, next) ->
if req.isSocket
req = _.extend req, _.pick(require('http').IncomingMessage.prototype, 'login', 'logIn', 'logout', 'logOut', 'isAuthenticated', 'isUnauthenticated')
middleware = passport.authenticate('bearer', { session: false })
middleware(req, res, next)