Node.js Passport Login System Tutorial

User authentication and login is the most important feature of many websites, and most likely a key component to your next project. In this video I will be covering absolutely everything you need to know about user login and authentication in the most concise and simple way. We will be using Express for our server backend and Passport to help us manage the logged in state of users. We will also be sure to properly encrypt and hash all user passwords so that our application is completely secure. By the end of this video you will have built a fully functional login system that you can use in any of your future projects.

📚 Materials/References:

GitHub Code:
Full Stack Node.js MongoDB Free Course:
Node.js Authentication Tutorial:

🧠 Concepts Covered:

– Setting up a server with Node.js and Express
– Setting up Passport with Node.js and Express
– How to encrypt user passwords
– Restricting access to routes to only logged in users
– Showing flash messages with Node.js and Express

🌎 Find Me Here:

My Website:

#PassportLogin #WDS #NodejsLogin


Xem thêm bài viết khác:


  1. Great stuff dude,
    but I had a problem using it for two logins, I tried implementing a separate login for Admin and Clients with same strategy but having issues on the admin's end……any hint or video on that?

  2. Great Job! Thank you very much!

  3. Good, but i got error here } catch {



  4. npm init -y
    thank me later

  5. I don't understand why you use 'npm devStart' when you can just write "nodemon" and its the same effect

  6. Try "app.set('view engine', 'ejs')" if it doesn't work with the hyphen.

  7. I am new to coding , i used php cookies & a Mysql database to store user data as login system lol
    I had no idea how login system works so i just used cookies
    it worked fine

    actually it was a comment section and i set up php cookies whenever someone correctly input their data in a login page

    im pretty sure this isnt a good way to do it , it feels weird

  8. 11:20 ternimal listen closely

  9. the best speed to view this video is at 0.75x. Normal is way too fast

  10. ur perfect but may i make suggestion, u go way too fast

  11. 0:28 rlly?
    0:32 phew

  12. Is the code for this simple project somewhere. I seem to be having issues getting my user by email after registering and can't figure out why

  13. What's passport?

  14. Passport authentication starts at 15:00

  15. when execute a node server.js then I have got this error "Error: secret option required for sessions"
    What should I do?

  16. How can I set file association of ejs files to "Embedded Javascript"? It is set to html by default but html doesn't understand the ejs formatting. I tried to find "Embedded Javascript" online but couldn't. I'm making do with some other ejs language support extension for now but I'd like to know how to get the one you have. Thanks!

  17. Hey thanks for th great content! However, Im a little confused as to why you use DELETE for logout and not POST. The general practice is to use POST right? Since we are not technically "deleting" anything.

  18. I dont see the point of using node.js… hosting companies dont run nodejs

  19. I like your video. But it just bothers me so much that you don't use semicolon. Hahaha

  20. I just have switched from php to node js for 2 weeks. Your training is first class. Very helpful. THANK YOU VERY MUCH.

  21. Not a single semicolon SMH


Leave a Reply