Adding secure local authentication

We have Facebook and Google authentication working perfectly. We should be able to sign in and go to http://localhost:3000/chat and get an authorized Socket.IO handshake, although we now cannot sign in using our local username and password.

Note

Technically, the function does come back as authorized, but we do not set the correct variables in the session anymore.

We also want to create a function that is much more secure than just a username check.

The passport-local module will work in the passport.authenticate middleware, but we will have to write our own logic. This is different than the other modules where the logic is written, and we just have to add our application specific parts. Let's build our authentication ...

Get Building Scalable Apps with Redis and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.