Node.js With Passport Authentication | Full Project



In this video we will build a complete authentication app with login, register and access control using Node.js, Express, Passport, Mongoose and more.

Sponsor: DevMountain Bootcamp

Code:

💖 Become a Patron: Show support & get perks!

Website & Udemy Courses

Follow Traversy Media:

Patron Resources:
Carlos Mafla Channel –
ParkFlyer Explorer SEO –

Need Domains & Hosting?
Inmotion Hosting –
Namecheap –

Nguồn: https://nonnaofitaly.com

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

40 comments

  1. During the dependency install my facecam is in the way. The two it is covering is “passport-local” and “express-ejs-layouts”. Sorry about that

    Reply
  2. hello, i am not getting the partial messages after inserting the include line in register.js

    when i inserted this line : <% include ./partials/messages.ejs %>
    i am getting the following error upon clicking the register button:
    SyntaxError: Unexpected token '/' in C:UserspandeDesktoptest4viewsregister.ejs while compiling ejs

    and i tried inserting this line as well: <%- include('./partials/messages.ejs'); %>

    now the syntax error is gone but i am not getting any partial messages.

    please help.

    Reply
  3. you are a life-saver…..thank youuuuuuuuuuuuuuu

    Reply
  4. cannot do with just free mongoDB ( MongoDB Compass Community)?

    Reply
  5. npm i express bcryptjs passport passport-local ejs express-ejs-layouts mongoose connect-flash express-session

    Reply
  6. Hii I am successfully able to implement this,but can somebody please explain me what if I have multiple pages like /shopping list, /myprofile so and how to implement this here we have auth.js in which we have isAuthorised bollean which return to next if user is logged out and or if false then user can open dashboard page.So how can I add more pages in this section??

    Reply
  7. Hey brad, any strategies for reset password in node js? Would love to see a short tutorial on reset password functionality

    Reply
  8. hai.. In this tutorial very useful and i got one error [TypeError: Cannot destructure property 'name' of 'req.body' as it is undefined.] in this error not clear so help me

    Reply
  9. Thank you for your videos Brad! I really enjoy the extra tools you recommend like Bootswatch. Makes the project much more visually appealing, presentable and more portfolio ready. I also like how your older videos/projects build on top of each other. Much appreciated!

    Reply
  10. i love your default chrome layout (when you open a new tab) ! what is it?

    Reply
  11. I copied all files directly from the Github page and I get: errmsg: 'E11000 duplicate key error collection: test.users index: username_1 dup key: { username: null }',
    [Symbol(mongoErrorContextSymbol)]: {}
    }
    Is this because I'm using my MongoDB account for another app that uses "username"?

    Reply
  12. honestly this couldv been way better hadn't you spent time on the ui , couldv saved more than 20mins of tme

    Reply
  13. Great course, thanks Brad.

    Reply
  14. This was by far the best online tutorial to create a login/logout system with NodeJS, Mongoose & Passport. ❤️
    PassportJS' documentation was so difficult to understand that I gave up trying to do this on my own. Thank you so much for this man! Much love! ❤️

    I just made a small change in my app – I used ejs instead of ejs-layouts as I was more familiar with the former.

    P.S.: Can you follow this video up with another video teaching us how to implement features like email ID verification, two-factor authentication, OAuth and Forgot Password? This would be a ready-to-deploy utility then!

    Reply
  15. someone can help me? how can i make a validation for a 'admin' user? so when logged as admin, it redirect to /admin/dashboard for exemple, with special features

    Reply
  16. Is there a video on how to update user registration details?

    Reply
  17. How can we hide aur password in the MongoURI before uploading it on github?

    Reply
  18. Hello Brad, you never run the model to be saved in the database, how come when you go to collections and the data are prefilled.?

    Reply
  19. Thx so much Brad you really are amazing teacher!

    Reply
  20. Thanks for an amazing video and tutorial! 🙂

    Reply
  21. Im getting this error: SyntaxError: Unexpected token '/' while compiling ejs

    Reply
  22. hey brad just bought your course MERN stack..can you do a quick tutorial on logging in or sign up with google or FB..pleassseee…thanks

    Reply
  23. at 24:00 you need this (because of newer MongoDB version):

    mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true })

    .then(() => console.log('MongoDB connected'))

    .catch(err => console.log(err));

    Reply
  24. Brad , Please do Facebook and Google login seperetely

    Reply
  25. Good day! I have some questions. Can anyone help me, please.
    1. // Passport Config

    require('./config/passport')(passport);
    Why are we sending the passport as a parameter before initializing it?

    2. In users.js why are we requiring passport, instead of sending it as a parameter to the function from app.js like we did it with passport.js?

    3.When we create LocalStrategy in passport.js we are sending an object {usernameField:"email"}, why are we doing it?

    4. Where is the salt for the hashed password stored? Every time user enters the password we generate the new salt, so the final hash will be different for 2 same passwords and if we compare them they will be different because of different salt, but it's not happening, why?

    Reply
  26. Use:
    <%- include('./partials/messages') %>

    Instead of:
    <% include ./partials/messages %>

    Reply
  27. 1:00:58

    Thank me later.

    Reply
  28. That’s a amazing tutorials. Thank you so much

    Reply
  29. This EJS is so fucked…

    Reply
  30. wtf is node? i'm on the weird part of youtube again…

    Reply
  31. Thanks Brad for such a nice video. In this, I was getting a connection error. I tried too much to get over it and founded the solution too. So I am posting here the issue and the solution.
    error: (node:578) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.
    Solution: // Connect to Mongo
    mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true })
    .then(() => console.log('MongoDB conneted…'))
    .catch(err => console.log(err));
    Conclusion: I have added `useUnifiedTopology: true ` to override the problem.

    Just giving the solution if any needed.
    Thanks

    Reply
  32. how to creating a role based User Authentication

    Reply
  33. am just wondering if someone can use this for a mern application

    Reply
  34. Is it possible to "block" another page then the "dashboard"? I would "block" the index of another server ….for example on localhost:9000, because i want to integrate the login into my existing node js project with an external login.

    Reply
  35. In the past weeks I finished your NodeJS, Express, Auth with JWT and this video. I cannot thank you enough.

    Reply
  36. I have followed all the steps correctly but i can't find any data being entered into collections in MongoDb. Can anyone help me with this?

    Reply
  37. Thank teacher, very useful for new guy like me.

    Reply
  38. Hi, I deployed this application with some visual changes into azure but it doesn't connect to the mongodb account . How can I get the application talking to mongodb?

    Reply
  39. funny part 1:10:05. So that's what it does.. 🙂

    Reply
  40. I don't normally leave comments but this was extremely helpful so thank you for sharing 🙂

    Reply

Leave a Reply