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/
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
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.
you are a life-saver…..thank youuuuuuuuuuuuuuu
cannot do with just free mongoDB ( MongoDB Compass Community)?
npm i express bcryptjs passport passport-local ejs express-ejs-layouts mongoose connect-flash express-session
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??
Hey brad, any strategies for reset password in node js? Would love to see a short tutorial on reset password functionality
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
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!
i love your default chrome layout (when you open a new tab) ! what is it?
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"?
honestly this couldv been way better hadn't you spent time on the ui , couldv saved more than 20mins of tme
Great course, thanks Brad.
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!
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
Is there a video on how to update user registration details?
How can we hide aur password in the MongoURI before uploading it on github?
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.?
Thx so much Brad you really are amazing teacher!
Thanks for an amazing video and tutorial! 🙂
Im getting this error: SyntaxError: Unexpected token '/' while compiling ejs
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
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));
Brad , Please do Facebook and Google login seperetely
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?
Use:
<%- include('./partials/messages') %>
Instead of:
<% include ./partials/messages %>
1:00:58
Thank me later.
That’s a amazing tutorials. Thank you so much
This EJS is so fucked…
wtf is node? i'm on the weird part of youtube again…
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
how to creating a role based User Authentication
am just wondering if someone can use this for a mern application
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.
In the past weeks I finished your NodeJS, Express, Auth with JWT and this video. I cannot thank you enough.
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?
Thank teacher, very useful for new guy like me.
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?
funny part 1:10:05. So that's what it does.. 🙂
I don't normally leave comments but this was extremely helpful so thank you for sharing 🙂