R
R
retyui2015-05-09 14:48:55
Node.js
retyui, 2015-05-09 14:48:55

Socket.io 1.x + Express 4.x + Passport.JS login and logout?

Authorization on the site is implemented using passport.js
Authorization in socket requests is implemented using passport.socketio ,
When the user exits the site

app.post '/logout',(req, res,next)->
    req.logout()
    res.redirect '/'

It is also necessary to terminate the connection in sockets, if it is established
How to implement this? or you know a more competent way to authorize users in sockets.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Lavrentiev, 2015-05-09
@lavrentiev

socket.io/docs is described right here :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question