Tuesday 31 October 2017

Question about Node+Passport social login and how it connects to Front End JS

I have a node js app with Google oAuth2.0 working via Passport.js. I can login/logout and I can grab User info and display it in my pug templates.The next thing I want to setup is socket.io for real-time comms.How do I identify who is logged in in the front end code where the socket.io client code would go?Basically I want the user to be able to log in, then chat/send messages as themselves to the server? What am I missing?How do I get to the user object that is created when the user is logged in? Session data? Cookies?Or do I need to handle Authentication completely differently?Thanks for your help.

Submitted November 01, 2017 at 01:59AM by b0z33

No comments:

Post a Comment