This video was God sent. Thank you very much for clearly explaining the mechanics of PassportJs behind the scenes. The documentation available online never mentions this.
Hey Zach, thanks a lot for taking the time putting this series together. I'm a finance major myself just learning to code, and you have the best tutorial on this subject by far. Really appreciate you
Amazing tutorial I am very new to node and have a project with a tight deadline and this is a life saver. Even with some some package migrations the tutorial holds up well
Thank you so much for your tutorial!!! I made an admin panel with PostgreSQL instead of Mongo, but your videos are the most helpful ones in the whole wide world! Thank you thank you thank you.
Great Billion dollar video that u gave us for free Great great explanation, great knowledge zach Thank you very much bro❤️❤️❤️❤️❤️❤️❤️❤️❤️ Once again thank u for this video
Really nice instruction video's!!! Learned a ton! But some things are a bit outdated. For example the req.logout() requires a function to be passed in like this: app.get("/logout", (req, res) => { req.logout((err) => { if (err) { return res.status(500).json({ message: "Error during logout." }); } res.render('login'); }); });
I just watched this video. Very informative. Question. Expression session creates a session Id and passport then creates another hash of your user object that it attaches to the cookie. Meaning you get something like “eyxabc.userhashedstring” - how do you intercept that part that passport hashes ( or get access to it before the session cookie is sent to the browser?
hey zach thank you so much for the video, you did an amazing job covering the holes and cracks In the documentation on how things work , i m facing an issue where the session i set in the landing page (using express session of course ) gets overwriten when the vistor authenticates all things indicates that passports is launching another session on authentication which is not the behavior i'm looking for , i would love to hear your opinion on the matter or anyone who had the same problem and thank you very much again for your work .
@@zachgoll true , specially when i followed your tuto to implemented passport authentication on an express session I made following other but similar examples , thank you for the tip and thank you again for your work we appreciate it a lot.
Hi Zach, I have implemented the same code, first time authentication gets succeed but once I refresh the page, the authentication fails can u clarify the doubt
Thanks a lot for the amazing tutorial. However I stil don't get why you query the database in the deserializeUser method? Because you already have the password in hand and below also works. The sample code on the passport.js documentation also does the same. Thanks! passport.deserializeUser((user, done) => { done(null, user) })
If i understand it correctly this is to verify the user is logged in, As it runs on every route it is making sure the user id in the session object matches a user id in the database. He goes over it around 9:00 in the video. I think the sample code works because you are just calling the done() function telling deserializeUser method that checks are complete, so you are effectively removing the check to see if the user exists in the database and telling passport everything is fine to continue. Hope that helps
last video in the Odin project series, but don't worry Zach, I've subscribed and ill be bach, Zack
Trust Me, This is the most under-rated tutorial in youtube. Thank you Zach for this.
p
p
This video was God sent. Thank you very much for clearly explaining the mechanics of PassportJs behind the scenes. The documentation available online never mentions this.
You deserve much more feedback for this gold tier tutorial series.
Hey Zach, thanks a lot for taking the time putting this series together. I'm a finance major myself just learning to code, and you have the best tutorial on this subject by far. Really appreciate you
authentication does not seem to be so daunting anymore, thanks zach 😄
I used this as a reference for implementing a login system at my workplace. Keep up the in depth content!
Just finished the six videos on Passport Local Strategy. Thankyou so much for this playlist!!
You’re welcome!!
This video deserves so much credit! Well made and explained clearly. I've taken a look at your code and adapted it for integration, thanks Zach! :D
I've been struggling with Express-session and passport for some time. Thank you for this video! Subscribed.
this is best explanation i have seen so far
Thank you for this much needed series , passport should link your videos in their documentation
Thank you Zach, the best passport local strategy tutorial, great dissection of the code. Subscribed
Thx Zach please don't stop with your videos ! Keep it up
Amazing tutorial I am very new to node and have a project with a tight deadline and this is a life saver. Even with some some package migrations the tutorial holds up well
Thanks you Zach
This is what i was searching!!!
great video man
Thank you so much for your tutorial!!! I made an admin panel with PostgreSQL instead of Mongo, but your videos are the most helpful ones in the whole wide world! Thank you thank you thank you.
Dude you nailed it,very good explaination!Keep going!
Great video, really helped me understand all the moving parts. Thank you!
One word: hero
Thank you so much Zach!
Excellent tutorial and explanations. Thanks Zach :)
Thank you. This tutorial is excelent!
Great Billion dollar video that u gave us for free
Great great explanation, great knowledge zach
Thank you very much bro❤️❤️❤️❤️❤️❤️❤️❤️❤️
Once again thank u for this video
You are super cool 🙂 to explain difficult things in easy way. 😊 Shared your work with my friends. Thank you.
Great informative video!! sir, thanks for this tutorial.
Really nice instruction video's!!! Learned a ton!
But some things are a bit outdated. For example the req.logout() requires a function to be passed in like this:
app.get("/logout", (req, res) => {
req.logout((err) => {
if (err) {
return res.status(500).json({ message: "Error during logout." });
}
res.render('login');
});
});
I just watched this video. Very informative. Question. Expression session creates a session Id and passport then creates another hash of your user object that it attaches to the cookie.
Meaning you get something like “eyxabc.userhashedstring” - how do you intercept that part that passport hashes ( or get access to it before the session cookie is sent to the browser?
hey zach thank you so much for the video, you did an amazing job covering the holes and cracks In the documentation on how things work , i m facing an issue where the session i set in the landing page (using express session of course ) gets overwriten when the vistor authenticates all things indicates that passports is launching another session on authentication which is not the behavior i'm looking for , i would love to hear your opinion on the matter or anyone who had the same problem and thank you very much again for your work .
Tough to know exactly what’s going wrong but in those cases I always use the VSCode debugger to just step through my code.
@@zachgoll true , specially when i followed your tuto to implemented passport authentication on an express session I made following other but similar examples , thank you for the tip and thank you again for your work we appreciate it a lot.
Thank you, sir🙏
This video is great. I’m beginner to programming. The conception of session and cookie made me so confused.
Sessions and cookies have to be some of the most confusing topics starting out because everyone just assumes that you already know how they work!
Hi Zach,
I have implemented the same code, first time authentication gets succeed but once I refresh the page, the authentication fails
can u clarify the doubt
can you upload the finished code as well?
so i cant use this if i am using react ?
where I can find your code?
"Unfortunately, these are not documented very well in the passport documentation, which is kind of a shame."
Hello odin project guys!
🤩🤩
You sound normal at 1.75 speed.
This is the most underrated comment
Liked and Subscribe
Thanks a lot for the amazing tutorial. However I stil don't get why you query the database in the deserializeUser method? Because you already have the password in hand and below also works. The sample code on the passport.js documentation also does the same. Thanks!
passport.deserializeUser((user, done) => {
done(null, user)
})
If i understand it correctly this is to verify the user is logged in, As it runs on every route it is making sure the user id in the session object matches a user id in the database. He goes over it around 9:00 in the video. I think the sample code works because you are just calling the done() function telling deserializeUser method that checks are complete, so you are effectively removing the check to see if the user exists in the database and telling passport everything is fine to continue. Hope that helps