I\'m using Koa, Passport.js and koa-session to authenticate users. So it basically looks like:
// session
var session = require(\'koa-session\');
app.keys = [con
I used a regex to grab the userId and found then in my database. Not the cleanest approach but it works well. I'm just using koa-session-store as my session with passport js.
var cookies = socket.request.headers.cookie;
var regEx = /passport"\:\{"user"\:"(.+?)"\}/g
var userIdMatches = regEx.exec(cookies);