Node.js Passport Login System Tutorial

42
2



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:
Patreon:
Twitter:
Discord:
GitHub:
CodePen:

#PassportLogin #WDS #NodejsLogin

Nguồn: https://taiduc.org

Xem thêm bài viết khác: https://taiduc.org/the-thao/

42 COMMENTS

  1. 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

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

  3. 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!

  4. 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.

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

  6. Hi Kyle…The tutorial is very helpful to me…I'm just a beginner to this.. Thank you… oh..hey how can I convert (Users array) into Nedb… Thank you again..

  7. I really did not enjoy this video as opposed to the JWT authentication one for example. I felt that you moved too fast through a lot of concepts when you started using the passport and passport-local modules. For example, what is a local strategy? It would've been nice if you'd explain the concepts a bit before starting to code

  8. Hello Kyle, one question please:

    you load the .env only for non-production environments, why doing so ? Don't we have to have a secret even in production ?

    thanks.

  9. nice… but one suggestion your speed is so fast and you did not explain anything you just speak and write code with nonstop. you can improve it

  10. Once again…best channel for web development….just as the name indicates.. simplify the web….thanks for the content…

  11. If you already have a login form setup with html and css, how would you get that to work instead of using ejs

  12. 11:10 – Installing bcrypt
    14:39 – Installing passport, passport-local, express-session, express-flash

  13. nice tutorial dear. do you have any vuejs tutorial that works on a project from scratch?. working on a project helps the application of every language.

  14. This is exactly what I needed, but because he isn't storing the information to a DB, it makes it a little difficult to implement.

LEAVE A REPLY

Please enter your comment!
Please enter your name here