Node.js Passport Login System Tutorial

  Рет қаралды 1,070,543

Web Dev Simplified

Web Dev Simplified

5 жыл бұрын

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: github.com/WebDevSimplified/N...
Full Stack Node.js MongoDB Free Course: • Full Stack Web Develop...
Node.js Authentication Tutorial: • Build Node.js User Aut...
🧠 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: webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
#PassportLogin #WDS #NodejsLogin

Пікірлер: 1 300
@eduardopassero47
@eduardopassero47 4 жыл бұрын
First you show what we're gonna do, then you teach how to get there. Excellent! This is one of my top 5 favorite dev channels.
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thank you!
@andersonl819
@andersonl819 4 жыл бұрын
What are the other four?
@santhosh3374
@santhosh3374 3 жыл бұрын
@@andersonl819 1)dev ed 2)programming with mosh(for intro to new tech) 3)telusko 4) Tech with tim
@p.c.principal7324
@p.c.principal7324 3 жыл бұрын
@@WebDevSimplified hes dumb. You’re not one of the best. You are the best. That’s not a question or something that everyone can see different. It’s a fuckin fact bro
@balajiravi9259
@balajiravi9259 3 жыл бұрын
@@santhosh3374 you missed traversy media 👍
@nsharma4981
@nsharma4981 3 жыл бұрын
Even though it took me 2 viewings to understand passport, I loved how complete this tutorial was, while also only focusing on the core functionality without any fluff. Thank you so much, Kyle, for valuing the viewer's time. 😊
@tahasalim9158
@tahasalim9158 4 жыл бұрын
Finally someone that's straight to the point, without stopping 2 hours every time to explain EJS or some basic stuff. THANK YOU!
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
You're welcome! I try to balance my videos so that I only spend time explaining the specific topic that is being covered.
@andreas543
@andreas543 4 жыл бұрын
This.
@mipadart
@mipadart 4 жыл бұрын
His videos are awesome, but some people who are beginner they need 2 hours of long explanation.
@maskman4821
@maskman4821 4 жыл бұрын
Yeah, straight to the point !!!
@nialltracey2599
@nialltracey2599 4 жыл бұрын
@@mipadart Indeed -- different people have different needs, but the standard KZbin "code tutorial" style is utterly weak. Every line is "what we're going to do is..." and "what we need to do is..." with no structured development of user knowledge. Practically the only structuring principle is "this is the order I type it in."
@youngfella556
@youngfella556 4 жыл бұрын
I was feeling learning javascript/node was an impossible thing for its very versatility. After 1 hour watching your video, feel so confident I can conquer it now. Thank you!
@guayadepew2556
@guayadepew2556 Жыл бұрын
Love your channel, Kyle! I'm entering my second year in the industry and have only found a few good channels among the many rest. I love how you write and explain in the manner that the developing flows. It's like artistry... much like my beloved original trainer. I'll be binging and learning with you for a while, so thank you! 💖
@theemacsen1518
@theemacsen1518 5 жыл бұрын
!!This channel is seriously underrated!! I mean your content is sooo 🔥🔥🔥
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thanks! I really appreciate it. Soon enough I will break into a larger audience but for now I am just a hidden gem 😜
@brilliantphos
@brilliantphos 5 жыл бұрын
You're laying the Chanel is good. Just because your nodejs basic is bad.
@arenddejong6609
@arenddejong6609 4 жыл бұрын
@@brilliantphos yeah because he is pro bro
@subashpandian3990
@subashpandian3990 4 жыл бұрын
@@WebDevSimplified it will happen soon bro bcoz of ur rocking knowledge
@arvsi5067
@arvsi5067 4 жыл бұрын
@@WebDevSimplified i want your contact number or email.
@Evokus
@Evokus Жыл бұрын
I wish every programming tutorials channel would teach like this. Telling the end result and then explaining everything from 0 is the best way to understand how things work, and since we can follow the code and apply it right away, it also keeps me motivated to continue learning.
@romarpatindol9840
@romarpatindol9840 2 жыл бұрын
You've saved me a lot of time because your tutorials are super simplified, I shared your video tutorials with my students and I encouraged them to learn web development from scratch, and your page has all we NEED. Thank you!
@flowerofash4439
@flowerofash4439 2 жыл бұрын
4:47 tell express to use ejs view engine. 9:49 express url encoded to access data from HTML form. 12:03 bcrypt hash password from post /register. 17:01 use "strategy" for local version passport. 18:42 & 27:55 passport serializeUser & deserializeUser. 19:41 & 28:10 passport done function. 20:36 bcrypt compare hash to authenticate user. 22:45 app.use flash. 23:15 - 24:41 app.use session. 23:57 require dotenv config. 24:41 app.use passport initialize & session. 25:05 passport.authenticate middleware in post/login to redirect if the user is authenticated or not. 25:30 failureFlash to send the error messages to ejs. 25:46 display errors on ejs. 27:10 error fix: pass in authenticateUser to localStrategy. 29:20 get username from passport. 30:13 protect home route from not logged in users. 31:49 prevent already logged users from logged in. 33:27 set up log out route. 34:17 method-override allow delete verb for html. 34:58 method-override html form url/action string. 35:51 error fix: res.redirect.
@Trixz-the
@Trixz-the 2 жыл бұрын
Thanks man
@soufianezid2277
@soufianezid2277 Жыл бұрын
thank you, this was helpful🤩
@yassineabdelouafi
@yassineabdelouafi Жыл бұрын
Thank You
@HannahG869
@HannahG869 Жыл бұрын
This is really helpful! Thank you.
@tanmaisaichennagiri5543
@tanmaisaichennagiri5543 2 ай бұрын
So at 30:13 is he telling how to do the “AUTHORIZATION” part??
@ShivamAgrawal
@ShivamAgrawal 4 жыл бұрын
as a beginner took me some time to figure some things out, but finally completed this and got to learn a lot out of it. thanks for this amazing tutorial :)
@larrylaconi3480
@larrylaconi3480 4 жыл бұрын
As a current coding camp student, I find this channel really essential to my understanding of NodeJS. The whole SET/GET/POST/USE thing was mush inside my head until I watch this video. And my class is working on a database project using Node & Express so I'm thinking I'll sign up for his course as well. Great job sir!
@rajeshseptember09
@rajeshseptember09 3 жыл бұрын
Absolutely no BS. straight to the point as always Kyle. Great work and a great channel to follow for the devs.
@NumbersOficial
@NumbersOficial 2 жыл бұрын
33:44 - Since passport version 0.6.0 (which was released only a few days ago by the time of writing this), req.logout is asynchronous. You will get the error: "req#logout requires a callback function." To fix it, all you need to do is replace this: app.delete('/logout', (req, res) => { req.logOut(); res.redirect('/login'); }); By this: app.delete('/logout', (req, res, next) => { req.logOut((err) => { if (err) { return next(err); } res.redirect('/login'); }); });
@EddieAtaberk
@EddieAtaberk 2 жыл бұрын
Thank you!
@JalgOfficial
@JalgOfficial 2 жыл бұрын
You are god
@ramonmaximiliano3557
@ramonmaximiliano3557 2 жыл бұрын
Thank you man!
@Yan-Digital
@Yan-Digital 2 жыл бұрын
Saved my life bro ...
@huta3778
@huta3778 2 жыл бұрын
thank you very much :)
@CsTrGaming
@CsTrGaming 5 жыл бұрын
Yo im glad I bumped into this channel, best tutorials, strait to the point!
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thanks! I'm glad you found my videos and enjoy them.
@vic-pm3rm
@vic-pm3rm 4 жыл бұрын
@@WebDevSimplified thanks Mr i really enjoy ur videos they're so easy and really easy to understand
@connorbunch3577
@connorbunch3577 2 жыл бұрын
I love how you broke the problem down into its most simple form with your little demo website. Thank you for keeping things simple!!!
@cgoodwin2127
@cgoodwin2127 4 жыл бұрын
This video is terrific. Lucid. Concise. To the point. Having watched maybe a dozen videos on passport, this is the best.
@DevCops
@DevCops 5 жыл бұрын
I don't know why this channel gets so little from its user!! You're amazing! THUMBS UP I am sharing this video to my Network. One more thing I have seen you using EJS lot of times!!! Could you please do some video in which you add react/vuejs in frontend!!
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thank you! I am working on React videos for when I come back from vacation as well as a React course coming up soonish
@DevCops
@DevCops 5 жыл бұрын
@@WebDevSimplified Awesome !!! I'll be waiting for them in my KZbin notification!!.. Is there a way to stay in touch with you!!
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
I have a discord server that you can join which is linked in the description of my newer videos. You can also follow me on Twitter or signup for the Learn React today email list.
@pyrofuzion
@pyrofuzion 5 жыл бұрын
This is exactly what I was looking for - thank you Kyle 👌
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
You're welcome!
@darkwater234
@darkwater234 2 жыл бұрын
This content is excellent. You don't waste my time with fluff and it makes sense. I went from feeling unsure how to do node web dev to ready to build anything in just this one video. nice work!
@soniia_aka3462
@soniia_aka3462 3 жыл бұрын
Most of my node js knowledge is owed to you. You don’t know how many jams you’ve gotten me out of. Legend!!
@hammedakindunbi
@hammedakindunbi 9 ай бұрын
Thanks to Kyle for this tutorial. If recently you are watching this tutorial you might get and error: "req#logout requires a callback function," when you try to logout. This error occurs because the req.logout() function requires a callback function in more recent versions of passport. Here's how you can modify the app.delete('/logout', ...) route to include a callback function: app.delete('/logout', (req, res) => { req.logout((err) => { if (err) { return next(err); } res.redirect('/login'); }); });
@mspanhaak
@mspanhaak 5 жыл бұрын
Interesting tutorial! I'm going to use your example and see if I can use it for one of my own projects. Learned something new :-) Thanks a bunch!
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thank you. I love that you are taking my tutorials and expanding upon them in your own projects. That is by far the best way to learn quickly, and the most fun in my opinion.
@dawoodshahzad9082
@dawoodshahzad9082 3 жыл бұрын
This is what I was actually searching for. Straight to the point and every line of code worth alot. God bless you!
@johnlayda3299
@johnlayda3299 Жыл бұрын
Hey, I watched this video year ago and now I am building a discird bot with an integrated website with login, register authentication and discord auth thank you very much for keeping on posting tutorial, This video is my stepping stone to start to be a full stack dev because I am a frontend dev and discord bot dev and noob at backend before, Also you helped a lot of people that are interested to build full stack app and do not know s to start.
@Ch3sterB
@Ch3sterB Жыл бұрын
FYI the function you use to logout the user now requires a callback function. app.delete('/logout', (req,res) => { req.logOut() res.redirect('/login') }) Doesn't work anymore and throws the error that it needs a callback function. app.delete("/logout", (req, res) => { req.logOut(function (err) { if (err) { return next(err); } res.redirect("/login"); }); }); Fixed it for me.
@Wieberleden810
@Wieberleden810 Жыл бұрын
Thanks!
@andrei-un3yr
@andrei-un3yr 4 жыл бұрын
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
@Hghtrt
@Hghtrt 3 жыл бұрын
www.passportjs.org/packages/passport-local/
@seanpaulson9098
@seanpaulson9098 Жыл бұрын
Anyone wandering passport local is username password login
@deeppatel3454
@deeppatel3454 3 жыл бұрын
All details in single shot without break. That's amazing.
@davidwaine4647
@davidwaine4647 10 ай бұрын
Hi Kyle, just wanted to thank you for putting so much energy and accuracy into your work. Lovely to watch and listen to.
@ayushmanbt
@ayushmanbt 5 жыл бұрын
Really nice tutorial. Thanks for helping me to clear my concepts :-)
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
I'm glad I could help!
@david_duong_CZ
@david_duong_CZ 4 жыл бұрын
This is a tutorial what I need. Thank you so so much. And if anyone can't download npm bcrypt so can download npm bcriptjs and just replace const bcrypt = required("brciptjs')
@codigoninja
@codigoninja 4 жыл бұрын
Like this: npm i bcryptjs and use it. const bcrypt = require('bcryptjs')
@ricook5406
@ricook5406 4 жыл бұрын
Thanks!
@sashatv138
@sashatv138 4 жыл бұрын
F:\333\Vanilla JS\passport-login_www>npm i bcryptjs npm WARN passport-login_www@1.0.0 No description npm WARN passport-login_www@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + bcryptjs@2.4.3 added 1 package from 6 contributors and audited 270 packages in 1.974s still not working...
@hk-nu2zt
@hk-nu2zt 4 жыл бұрын
thanks dude!
@ricardorosal8971
@ricardorosal8971 4 жыл бұрын
tks dude!
@alfredliu5075
@alfredliu5075 4 жыл бұрын
I found this being one of the few rare tech channels where 0.75x speed works the best rather than 1.25x. Thanks man.
@amneetsandhu7734
@amneetsandhu7734 3 жыл бұрын
Thank you man. Got to learn in a very straight forward way and it was exactly what I wanted. Nothing less and nothing overburdeningly more.
@pastorfred2543
@pastorfred2543 5 жыл бұрын
Woooooow, you're the best.. I will forever follow you. Thank you Sir. You made me know that, nothing is impossible..
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thank you! I'm really glad you enjoyed the video.
@pastorfred2543
@pastorfred2543 5 жыл бұрын
@@WebDevSimplified You're very welcome Sir.
@ManishKarki
@ManishKarki 5 жыл бұрын
Gonna need this very soon thanks. Edit: I'd love to learn HTML Canvas too
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
HTML Canvas is something I also want to learn more about. It is really useful for doing things like game development.
@jeetuvakode2654
@jeetuvakode2654 4 жыл бұрын
You are awesome. Finally met someone cool in finishing all stuff easily in KZbin. Lot's of love 💕.
@kenmtb
@kenmtb Жыл бұрын
This man is elite. Thank you for taking the time to carefully explain each step.
@elvinjafarli6257
@elvinjafarli6257 4 жыл бұрын
Man, your channel is underrated. The contents are amazing and explained well. Ask in the beginning of every video for like, subscription and user engagement in the comment section. Keep the game going!
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thanks! I have been asking people to subscribe in newer videos, but sometimes I forget.
@meridjal
@meridjal 4 жыл бұрын
All those missed semi-colons, got to love JS
@himbary
@himbary 3 жыл бұрын
Use a code formatter and they all get placed with a single click
@alessandramiazato
@alessandramiazato 4 жыл бұрын
this is really simplified, actually Im appending this login page in the previous node express project that you taught thanks!!
@minewarz
@minewarz 3 жыл бұрын
I'm impressed at how calmly you manage to respond to an error, and how easily and calmly you point it out and fix it.
@victormog
@victormog 3 жыл бұрын
I would suggest using *bcryptjs* instead of *bcrypt.* The API is the same but the dependencies are zero (and less problems).
@kmbcg
@kmbcg 4 жыл бұрын
1:42 - Installing express, ejc 2:05 - Installing nodemon, dotenv 2:56 - Creating first script 11:10 - Installing bcrypt 14:39 - Installing passport, passport-local, express-session, express-flash 34:17 - Installing method-override PS: I wrote this comment just to remind myself of the times for each step in the video that was of interest to me, but as it has helped other people, it needs updates to be more complete. Anyone who can help, please reply to this comment. PS 2: For a more secure environment, if some user send his email or password wrong at login, just warn that one of both is wrong, but don't specify which one.
@minewarz
@minewarz 3 жыл бұрын
34:17 - Installing method-override
@kmbcg
@kmbcg 3 жыл бұрын
@@minewarz Thanks.
@donkey_tube
@donkey_tube Жыл бұрын
HELP!!! Opps.. 27:08 where can i get this file ( strategy.js file ) ?
@kmbcg
@kmbcg Жыл бұрын
​@@donkey_tube I don't remember much about this video. :/
@henry_sparks
@henry_sparks 4 жыл бұрын
YOU ARE A SUPERHERO! I Can't express my appreciation and gratitude to you and your content. I am learning web dev and you have been a great help. Really appreciate you man. Thanks again.
@catjet148
@catjet148 4 жыл бұрын
I love it! The clearest video about session and local passport. Not too much detail, but enough for us to debug and understand how it works! You are truly amazing and handsome, though I am a guy.
@bakonyimate796
@bakonyimate796 3 жыл бұрын
5:31 "Super simple server setup" It's like the 'supercalifragilisticexpialidocious' in Marry Poppings. 😂
@TheSaintsVEVO
@TheSaintsVEVO 3 жыл бұрын
I feel you should talk about how using express sessions in its default options would not scale in production. You need a session store like as a database, or things would most likely break in bigger applications.
@rafi-leigh
@rafi-leigh 6 ай бұрын
did you watch the video? he says that this is not production. you need db
@shoeshiner9027
@shoeshiner9027 4 жыл бұрын
I just have switched from php to node js for 2 weeks. Your training is first class. Very helpful. THANK YOU VERY MUCH.
@RainOnline
@RainOnline 3 жыл бұрын
same! but i lost at passport stuff
@chinosts
@chinosts 3 жыл бұрын
Amazing video dude :) I had to check twice that my video setting werent on 1.5x play because you are just so fast! Good pace though and well delivered. I am subbed for sure.
@sergsergesrgergseg
@sergsergesrgergseg 3 жыл бұрын
can you make a tutorial that also includes logging into a database?
@mahadnifsey9650
@mahadnifsey9650 Жыл бұрын
Great Tutorial, thank you for all the help as always! Because of the new Session release, the 'req.logout' now requires a callback function for us to redirect the logout. See below for anyone that has the same problem; : app.delete('/logout', function(req, res) { req.logout(function(err) { if (err) { return next(err); } res.redirect('/login'); }); });
@webwritingwithmarianne2649
@webwritingwithmarianne2649 Жыл бұрын
Thank you!
@massimolaurini7486
@massimolaurini7486 2 ай бұрын
Hey I know this is really old but i get Cannot GET /loggout, anyone know what im doing wrong?
@rosielmusic
@rosielmusic Жыл бұрын
Learned more during this video than I have in the last 12 weeks, thank you! 😅
@ZyroHD
@ZyroHD 4 жыл бұрын
Thanks for the great tutorial! This is the first tutorial I used to Node.js. Great tutorials, keep it up!
@Adefuye
@Adefuye 4 жыл бұрын
If you already have a login form setup with html and css, how would you get that to work instead of using ejs
@DKGAMINGG589
@DKGAMINGG589 4 жыл бұрын
just watch this video ( kzbin.info/www/bejne/rJS6pIKuoq2fpsk ) u will understand everything.
@dhruvvit
@dhruvvit 4 жыл бұрын
It's not big deal
@koloskerekgyarto676
@koloskerekgyarto676 4 жыл бұрын
Try "app.set('view engine', 'ejs')" if it doesn't work with the hyphen.
@LongNQW
@LongNQW 2 жыл бұрын
Passport js was tough to learn. Used tons of resources, but that video was my main help. Thanks a lot!🙏
@gavinyu6251
@gavinyu6251 3 жыл бұрын
Thank you for doing this. You cannot believe how many people you are helping!
@alphamackie8456
@alphamackie8456 4 жыл бұрын
Hey this video is great! It has helped my understanding greatly, could you do a role based authentication video using mongodb? Thanks very much
@dewangsolanki4093
@dewangsolanki4093 4 жыл бұрын
hello sir, looking for the same. PLS drop down a link if u got one :)
@willysnowman
@willysnowman 4 жыл бұрын
+1
@larryklein8307
@larryklein8307 4 жыл бұрын
Thanks for the video. I keep getting Error: Unknown authentication strategy "local"
@dthoma128
@dthoma128 3 жыл бұрын
Thank you once again Kyle ... you are a master at explaining and demo-ing these technologies!
@itzsaucy5715
@itzsaucy5715 Жыл бұрын
Your lectures are the only ones I have ever slowed down lol. I love your videos and I know you will probably never see this but I wanted to take a moment to comment just to tell you how much I appreciate all of the content you have put out for free on youtube. I would have never been able to make it through my bootcamp without it.
@fightclub7440
@fightclub7440 Жыл бұрын
In which format i have to provide data in const users = [ ].... I have provided in this format Const users = [ { id: 1, name: "s", email: "s@s", password: "s" } ] And i tried login using this email and password and that didn't worked.....can you please help me in which format i have to give detail.....
@chippandenga6722
@chippandenga6722 Жыл бұрын
Users is an array of objects and your presentation looks correct. I think you might be having an error with something else🤔
@AmiteshSrivastava98
@AmiteshSrivastava98 4 жыл бұрын
I saw your video on using jwt instead of sessions. If I want to use that, then should I still be using express-session? Could you perform a video that explains how to integrate passport and jwt?
@diogomarinho5998
@diogomarinho5998 3 жыл бұрын
That's my question too. Do u solved it?
@uzair004
@uzair004 3 жыл бұрын
No you don't need sessions for JWT. Jwt identifies user by checking jwt token in each request. While on session based passport strategies a cookie is checked on server side. You can also use passport-local without session but then it will need auth on every route and you need more work to identify user. In JWT auth server don't store any data about User. Token is saved on client side and server check for token in request.
@jonasrasmussen8067
@jonasrasmussen8067 4 жыл бұрын
this makes me the good kind of confused
@_benff
@_benff 4 жыл бұрын
This KZbin channel is a goldmine!
@KieranMcLeish
@KieranMcLeish 4 жыл бұрын
I think this is the first tutorial I've had to set to 0.75 to be able to follow along! Amazing stuff, great content, would definitely recommend!
@paulinaborowiecka1743
@paulinaborowiecka1743 3 жыл бұрын
hahah I did the same with the speed
@ideashub3608
@ideashub3608 4 жыл бұрын
Can you help to debug this error on my console = express-session deprecated req.secret; provide secret option server.js :22:9
@reubenfernandes3814
@reubenfernandes3814 4 жыл бұрын
Hey i tried doing the same thing with my Mongodb but im getting error "cannot read property email of null" what should i do??
@TheBertiescott
@TheBertiescott 4 жыл бұрын
Express has changed how it does body parsing you now need github.com/expressjs/body-parser to use req.body
@saadatsult7031
@saadatsult7031 4 жыл бұрын
u helped me so much! i have a deadline today on authentication. your video literally saved me from failure
@daveperry7179
@daveperry7179 3 жыл бұрын
great stuff Kyle. this was my first experience with node, npm and libraries etc. Now gonna try and incorporate my project into it. Thanks
@kcz-q4
@kcz-q4 Жыл бұрын
We would say in German: Ehrenmann 💪
@martini9388
@martini9388 11 ай бұрын
Error: req#logout requires a callback function. If you got this error in the end of tutorial that's because passport was changed since Kyle uploaded this video. Now req.logout is asynchronous. Can't rly post this code here but if you go to stack overflow you will find solution there. Just copy paste error title. As always, thx for upload Kyle!
@heliospace
@heliospace 10 ай бұрын
kzbin.info/www/bejne/mWfdemSdeMaCY8Usi=54fx_itohSqkmJEX&t=907
@jothinayagan.iyyappan
@jothinayagan.iyyappan 3 жыл бұрын
Man! Seriously you're seriously super-duper. My number #1 channel is yours. Keep up man. Thanks.
@engespress
@engespress 3 жыл бұрын
Wow, you're a genius. So fast and precise. Thanks for the tutorial. It's really helpful and well-explained.
@maxxabillionmaxxabillion8063
@maxxabillionmaxxabillion8063 4 жыл бұрын
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.
@vaibhavrawat8419
@vaibhavrawat8419 3 жыл бұрын
I am trying very hard to use this code and connect it with mongo db but till now I cannot do it.
@anth0ni33
@anth0ni33 3 жыл бұрын
Like he said, watch his video on connecting databases. Then come back to this video. It should be easier then.
@Daddytronics
@Daddytronics 3 жыл бұрын
I'm not convinced passport saves much effort. The amount of boilerplate and dependencies it introduces. In the end writing my own jwt auth seems more streamlined but maybe I'm missing something?
@EnesKab
@EnesKab 3 жыл бұрын
passportjs also has support for logging in with other providers like google, facebook, twitter etc. The real value of passportjs comes from these actually. It is a lot of effort to integrate all these providers' login to the project. And i agree with you about the custom jws. If this is only what you need, it is ok.
@exploringnaturalbeauty2102
@exploringnaturalbeauty2102 3 жыл бұрын
Can anybody help me , I am using node.js along with postgresql database , And I don't know how to use passport in it , is all the procedures same as specified in the video , please help me !
@tylerdurden2832
@tylerdurden2832 3 жыл бұрын
Thank you so much. No words can EXPRESS my thank you. Subscribed, one of the best web dev channels.
@oddshapedrock7831
@oddshapedrock7831 3 жыл бұрын
Thanks for the tutorial. This helped me out a lot, and I couldn't find anything quite like this anywhere else.
@malvikatiwari3857
@malvikatiwari3857 4 жыл бұрын
Hy, actually I am having a TypeError at req.isAuthenticated(). Can you help with this.
@rahulsolankib
@rahulsolankib 4 жыл бұрын
Hi malvika 😅
@Poison69
@Poison69 3 жыл бұрын
@@rahulsolankib The girl is tryna get some help with her error and my dude is tryna slide in.
@geekofia
@geekofia 3 жыл бұрын
Install types for passport and node
@malvikatiwari3857
@malvikatiwari3857 3 жыл бұрын
@@geekofia thank you
@piemre
@piemre 3 жыл бұрын
@@Poison69 puahhahhahahaha
@FredWheezy
@FredWheezy 9 ай бұрын
I thought we were making a passport airport login registration portal🤣
@dhwanilpatel252
@dhwanilpatel252 3 жыл бұрын
Buddy, You rock the stage. Awesome flow and explanation. Full of fire. Thank you so much...🔥🔥🔥
@techtantra8360
@techtantra8360 4 жыл бұрын
U r very clear with concepts man. U just know where is error and everything. Keep making tutorials. Good luck!
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thanks!
@MuhammadUsman-rp3ph
@MuhammadUsman-rp3ph 4 жыл бұрын
if someone has problem with "npm i bcrypt" use "npm i bcryptjs" instead
@angry_porkchop
@angry_porkchop 4 жыл бұрын
Pretty sure that its slower than bcrypt tho
@carlonnrivers
@carlonnrivers 5 жыл бұрын
So I'm midway integrating the login system into my Mybrary website aka: - creating my own register and login routes and their models and views, - and was able to successfully save the user, email and bcrypted password to the local database server upon registration. So I know when I deploy it online, it'll be saved to the database online there too. Small question: That atlas database, is that available for everyone to see? I know I encrypted my password, but there may be lots of user information there and I don't want anyone to access that database just by link. Main question: In this video at 15:49 you install the passport local strategy for using logins locally. What strategy do I use so that I can deploy it online? I don't want to use a middleware like Facebook or Gmail logins, because the user already can register and it saves to the database, so what strategy do I use, in order to make possible what is currently possible with the passport-local strategy? Would syntax also be the same/similar, or do I have to find docs myself for that?Thanks in advance! :D
@vngaminghindi2472
@vngaminghindi2472 4 жыл бұрын
I just Subscribed, thanks for these random videos that really need
@ArisAris-fs1ip
@ArisAris-fs1ip Жыл бұрын
To tell the truth Kyle, 6 months ago when i was a noob, i could not understand your explanations. Now they are build mid level projects for company interviews, and I know some javascript, you are trully helpfull.
@wackodreamer
@wackodreamer 4 жыл бұрын
This was super helpful! If anyone in the comments knows how I could swap the users array for a database in mongodb i would appreciate any info!
@wackodreamer
@wackodreamer 4 жыл бұрын
I have figured it out
@scottregb
@scottregb 4 жыл бұрын
@@wackodreamer Can you share your solution? I am looking to do the same thing.
@bakonyimate796
@bakonyimate796 3 жыл бұрын
@@scottregb Me too. Please.
@sardendibs
@sardendibs 2 жыл бұрын
Can you share the solution? I am stuck at exactly this. The code in this tutorial won't pull the email and password from a MongoDB db - everything is "undefined".
@iammakimadog
@iammakimadog 4 жыл бұрын
why don't we use the built-in crypto instead of bcrypt
@CknSalad
@CknSalad 4 жыл бұрын
bcrypt is the better choice if you want to hash passwords. it's much easier for an attacker to 'reverse' a 'hash' on 'native-crypt'.
@mokroargra7277
@mokroargra7277 3 жыл бұрын
I would buy all of this guy content. I bought his reactjs course to convert my vanilla js app to react. He explains things really well.
@WebDevSimplified
@WebDevSimplified 3 жыл бұрын
Thank you so much for the support!
@mohitjha2686
@mohitjha2686 3 жыл бұрын
That's what we call quality, excellent explanation, KEEP IT UP!
@achintsrivastava3601
@achintsrivastava3601 4 жыл бұрын
This guy's face is brighter than my future !!
@someonefromworld8368
@someonefromworld8368 4 жыл бұрын
If you got error when you install bcrypt you can use downgrade version via 'npm i bcrypt@3.0.6'
@radoslavsmolen1655
@radoslavsmolen1655 4 жыл бұрын
Yeah, I had some issue with bcrypt too, due to older Node.js version, but after I tried version from this version compatibility list, everything works just OK. www.npmjs.com/package/bcrypt
@_V__.
@_V__. 4 жыл бұрын
Yup, had the same issue! Thanks a bunch!
@roguishowl3915
@roguishowl3915 2 жыл бұрын
Thank you for literally simplifying exactly what I need for my project ✌🏻
@frank1369
@frank1369 4 жыл бұрын
Huge Work in 36 Minutes! Thanks a Lot! You are really GREAT! I like your style "Quick Gun"
@ahmadalwazzan384
@ahmadalwazzan384 4 жыл бұрын
Can you still be a web developer if your brain doesn't work half as fast as this guy?
@debatrachatterjee2666
@debatrachatterjee2666 3 жыл бұрын
Absolutely. Nobody gets to know in an instant what they have to do and in the exact order they have to do it. These tutorials have a lot of homework , revisions and errors going on backstage. It's perfectly fine to make errors!
@Tommy-jn9ps
@Tommy-jn9ps 3 жыл бұрын
Yes, you can. I bet Kyle makes a lot of errors, but that's normal for programmers. These tutorials are usually coded out beforehand, because who would like to sit here and watch Kyle making the idea and debugging ale things it would take at least 3 hours so you get the idea.
@tohodakilla
@tohodakilla 4 жыл бұрын
hot content 🔥🔥🔥 hot host 🔥🔥🔥
@fyfoh
@fyfoh Жыл бұрын
This is the cleanest code walkthrough I've ever seen.
@jamiroquaiordie
@jamiroquaiordie Жыл бұрын
i saw this tutorial a few days ago... i really struggled getting it.. i went crazy watching so many videos, reading stack overflow answers and so many days after, return to this and really quite got it all... for all those out there going nuts with this things, patience.. your actions will reward you, but you have to do the work
@aLQuarter
@aLQuarter 4 жыл бұрын
Playback speed = 0.25
@GerardoBelot
@GerardoBelot 4 жыл бұрын
absolutly!!!!!
@janickbraun1302
@janickbraun1302 3 жыл бұрын
The tutorial: 40min My working time: 3h
@uriah117
@uriah117 3 жыл бұрын
Definitely takes time to soak in the info and implement it on your own project. The important part is understanding it. :)
@ogundipepelumi4927
@ogundipepelumi4927 3 жыл бұрын
Lol, i know right.
@oddshapedrock7831
@oddshapedrock7831 3 жыл бұрын
lol took me about 17 hours, but in my fairness, I completely edited the code to fit my needs which were quite strict.
@jimhalpert9803
@jimhalpert9803 3 жыл бұрын
Well , the youtuber speaks in like 1.5x speed lol
@syednomanahmed3526
@syednomanahmed3526 4 жыл бұрын
Lots of very useful concepts explained with super simple example. Excellent Work. Thanks
@Quadropheniaspain
@Quadropheniaspain Жыл бұрын
Amazing, always clear and simple. how much i have learned from you. thank you very much mate! i'm so grateful keep on like this
JWT Authentication Tutorial - Node.js
27:36
Web Dev Simplified
Рет қаралды 1 МЛН
Build Node.js User Authentication - Password Login
13:31
Web Dev Simplified
Рет қаралды 514 М.
Алексей Щербаков разнес ВДВшников
00:47
GIANT umbrella by Tsuriki Show
00:15
Tsuriki Show
Рет қаралды 7 МЛН
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 24 МЛН
Learn Express JS In 35 Minutes
36:03
Web Dev Simplified
Рет қаралды 785 М.
How To Debug React Apps Like A Senior Developer
21:07
Web Dev Simplified
Рет қаралды 105 М.
Express JS #15 - Passport.js Authentication
37:41
Anson the Developer
Рет қаралды 11 М.
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 185 М.
Building Node.js Authentication from Scratch
39:09
Piyush Garg
Рет қаралды 135 М.
We Can Finally Animate height: auto; in CSS!
12:59
Web Dev Simplified
Рет қаралды 56 М.
Express JS #10 - Validation
31:33
Anson the Developer
Рет қаралды 8 М.
Only The Best Developers Understand How This Works
18:32
Web Dev Simplified
Рет қаралды 95 М.
Implementing User Authentication With Node JS and PostgreSQL
1:29:33
Conor Bailey
Рет қаралды 118 М.
Алексей Щербаков разнес ВДВшников
00:47