How to get session object under beforeConnect method inside sails.config.sockets ?

75 views
Skip to first unread message

Sumit Yadav

unread,
Aug 22, 2017, 5:43:36 AM8/22/17
to sails.js
It was onConnect in v0.10 there inside sails.config.sockets earlier instead beforeConnect now in v0.11 which is being used to allow or deny every socket connection requestting sails app to connect. Am looking around for session object under beforeConnect method whose prototype is

 beforeConnect: function(handshake, cb) {
}

Is there any way to get session object under this method to make authentication easy using session keys ?

Here is current prototype for afterDisconnect method which allows me to get session object.

afterDisconnect:function(session,socket,cb){
//perfect
}




Reply all
Reply to author
Forward
0 new messages