passport.socketio

passport-socketio breaks passport implementation?

为君一笑 提交于 2020-01-06 08:32:09
问题 This is my socket config: // set authorization for socket.io io.set('authorization', passportSocketIo.authorize({ cookieParser: express.cookieParser, key: 'connect.sid', // the name of the cookie where express/connect stores its session_id secret: '1234', // the session_secret to parse the cookie store: sessionStore, // we NEED to use a sessionstore. no memorystore please success: function (data, accept) { console.log('successful connection to socket.io'); // The accept-callback still allows

Passport.socketio has issues finding session

烈酒焚心 提交于 2019-12-24 01:45:28
问题 I am trying to access the session from sockets, but can't seem to make a connection. Without fail, authorization fails and I get the fail callback with the following message: failed connection to socket.io: No session found I will place all my code here so that it might be easier to spot what I'm doing wrong. var express = require('express'); var app = express(); var http = require('http'); var socketio = require('socket.io') var passportSocketIo = require('passport.socketio'); var port =