Node.js Passport Login System Tutorial

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 1,3 тис.

  • @eduardopassero47
    @eduardopassero47 5 років тому +516

    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  5 років тому +37

      Thank you!

    • @andersonl819
      @andersonl819 4 роки тому +17

      What are the other four?

    • @santhosh3374
      @santhosh3374 4 роки тому +25

      @@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 роки тому +4

      @@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 роки тому +14

      @@santhosh3374 you missed traversy media 👍

  • @alfredliu5075
    @alfredliu5075 4 роки тому +13

    I found this being one of the few rare tech channels where 0.75x speed works the best rather than 1.25x. Thanks man.

  • @flowerofash4439
    @flowerofash4439 2 роки тому +97

    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.

  • @tahasalim9158
    @tahasalim9158 5 років тому +326

    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  5 років тому +63

      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 5 років тому

      This.

    • @urbaandesi
      @urbaandesi 4 роки тому +24

      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 роки тому +12

      @@urbaandesi Indeed -- different people have different needs, but the standard UA-cam "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."

  • @NumbersOficial
    @NumbersOficial 2 роки тому +221

    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');
    });
    });

  • @youngfella556
    @youngfella556 4 роки тому +14

    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!

  • @theemacsen1518
    @theemacsen1518 5 років тому +330

    !!This channel is seriously underrated!!
    I mean your content is sooo 🔥🔥🔥

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +47

      Thanks! I really appreciate it. Soon enough I will break into a larger audience but for now I am just a hidden gem 😜

    • @arenddejong6609
      @arenddejong6609 5 років тому +1

      @Xingming Pinyin yeah because he is pro bro

    • @subashpandian3990
      @subashpandian3990 5 років тому +3

      @@WebDevSimplified it will happen soon bro bcoz of ur rocking knowledge

    • @arvsi5067
      @arvsi5067 4 роки тому

      @@WebDevSimplified i want your contact number or email.

    • @Alexander-re8vz
      @Alexander-re8vz 3 роки тому

      @@WebDevSimplified Hi Webde, i am getting an error called: Error: Cannot find module 'dotenv' do you know how to fix it?

  • @ArisAris-fs1ip
    @ArisAris-fs1ip Рік тому +1

    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.

  • @nsharma4981
    @nsharma4981 4 роки тому +40

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

  • @kmbcg
    @kmbcg 4 роки тому +110

    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 роки тому +6

      34:17 - Installing method-override

    • @kmbcg
      @kmbcg 3 роки тому +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. :/

  • @CsTrGaming
    @CsTrGaming 5 років тому +54

    Yo im glad I bumped into this channel, best tutorials, strait to the point!

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +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

  • @Evokus
    @Evokus 2 роки тому +2

    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.

  • @hammedakindunbi
    @hammedakindunbi Рік тому +8

    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');
    });
    });

  • @jamiroquaiordie
    @jamiroquaiordie 2 роки тому

    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

  • @rajeshseptember09
    @rajeshseptember09 3 роки тому +15

    Absolutely no BS. straight to the point as always Kyle. Great work and a great channel to follow for the devs.

  • @shoeshiner9027
    @shoeshiner9027 4 роки тому +1

    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 4 роки тому +2

      same! but i lost at passport stuff

  • @ShivamAgrawal
    @ShivamAgrawal 4 роки тому +13

    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 :)

  • @cgoodwin2127
    @cgoodwin2127 5 років тому +1

    This video is terrific. Lucid. Concise. To the point. Having watched maybe a dozen videos on passport, this is the best.

  • @guayadepew2556
    @guayadepew2556 Рік тому +7

    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! 💖

  • @connorbunch3577
    @connorbunch3577 3 роки тому +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!!!

  • @mahadnifsey9650
    @mahadnifsey9650 Рік тому +4

    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');
    });
    });

  • @larrylaconi3480
    @larrylaconi3480 4 роки тому +2

    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!

  • @david_duong_CZ
    @david_duong_CZ 5 років тому +17

    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 5 років тому +3

      Like this:
      npm i bcryptjs
      and use it. const bcrypt = require('bcryptjs')

    • @ricook5406
      @ricook5406 5 років тому

      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!

  • @mokroargra7277
    @mokroargra7277 4 роки тому +1

    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.

  • @elvinjafarli6257
    @elvinjafarli6257 5 років тому +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  5 років тому +1

      Thanks! I have been asking people to subscribe in newer videos, but sometimes I forget.

  • @deeppatel3454
    @deeppatel3454 3 роки тому +2

    All details in single shot without break. That's amazing.

  • @DevCops
    @DevCops 5 років тому +10

    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 років тому +4

      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 UA-cam notification!!..
      Is there a way to stay in touch with you!!

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +2

      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.

  • @leenagupta7801
    @leenagupta7801 3 роки тому +1

    Finally I found my mentor for my upcoming 4 year journey✌

  • @pastorfred2543
    @pastorfred2543 5 років тому +3

    Woooooow, you're the best.. I will forever follow you. Thank you Sir. You made me know that, nothing is impossible..

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +1

      Thank you! I'm really glad you enjoyed the video.

    • @pastorfred2543
      @pastorfred2543 5 років тому

      @@WebDevSimplified You're very welcome Sir.

  • @johnlayda3299
    @johnlayda3299 2 роки тому +1

    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.

  • @meridjal
    @meridjal 4 роки тому +7

    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

  • @davidturner1079
    @davidturner1079 3 роки тому

    I wish I knew 90% of what you were showing. I know maybe 50%. I feel like there's a lot of knowledge I just don't know. Most people say "Ok. That's how that's done." My brain requires that I understand why each section does what it does or it won't absorb it. This instruction has helped some, but there are many sections where it's just copy me code.
    It's still much better than others.
    Thank you kindly for what you have created. =)

  • @mspanhaak
    @mspanhaak 5 років тому +3

    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 років тому +3

      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.

  • @romarpatindol9840
    @romarpatindol9840 2 роки тому +1

    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!

  • @victormog
    @victormog 3 роки тому +9

    I would suggest using *bcryptjs* instead of *bcrypt.* The API is the same but the dependencies are zero (and less problems).

  • @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!!

  • @pyrofuzion
    @pyrofuzion 5 років тому +3

    This is exactly what I was looking for - thank you Kyle 👌

  • @sidharthmak
    @sidharthmak 3 роки тому +1

    Thanks a lot sir. There is not much I can do except liking and subscribing, but I hope this comment makes you understand how much I appreciate this video.

  • @TheSaintsVEVO
    @TheSaintsVEVO 3 роки тому +7

    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 11 місяців тому

      did you watch the video? he says that this is not production. you need db

  • @catjet148
    @catjet148 4 роки тому +1

    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.

  • @MaxSharpy
    @MaxSharpy Рік тому +3

    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 Рік тому

      ua-cam.com/video/c6zI1gCaO-c/v-deo.htmlsi=54fx_itohSqkmJEX&t=907

  • @itzsaucy5715
    @itzsaucy5715 2 роки тому

    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 2 роки тому

      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 2 роки тому

      Users is an array of objects and your presentation looks correct. I think you might be having an error with something else🤔

  • @kcz-q4
    @kcz-q4 2 роки тому +2

    We would say in German: Ehrenmann 💪

  • @darkwater234
    @darkwater234 3 роки тому +1

    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!

  • @bakonyimate796
    @bakonyimate796 4 роки тому +7

    5:31
    "Super simple server setup"
    It's like the 'supercalifragilisticexpialidocious' in Marry Poppings.
    😂

  • @KieranMcLeish
    @KieranMcLeish 4 роки тому +2

    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!

  • @sergsergesrgergseg
    @sergsergesrgergseg 3 роки тому +13

    can you make a tutorial that also includes logging into a database?

  • @DelliumM8
    @DelliumM8 5 років тому +1

    I decided to use Node.js as my backend for some of my Android apps, but I was getting really tired of using Firebase as my auth service. I must say this video is exactly what I was looking for, thank you very much.

  • @ayushmanbt
    @ayushmanbt 5 років тому +3

    Really nice tutorial. Thanks for helping me to clear my concepts :-)

  • @7oda_alnakeeb
    @7oda_alnakeeb 3 роки тому

    after 1 year this video help me to create a login & register system for my socket.io app that I learned form u too ur just a legend

  • @ManishKarki
    @ManishKarki 5 років тому +3

    Gonna need this very soon thanks.
    Edit: I'd love to learn HTML Canvas too

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +3

      HTML Canvas is something I also want to learn more about. It is really useful for doing things like game development.

  • @minewarz
    @minewarz 3 роки тому +1

    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.

  • @Ch3sterB
    @Ch3sterB Рік тому +5

    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.

  • @kim92se64
    @kim92se64 5 років тому

    After watching this tutorial only for 5 minutes i realize that you are a awesome developer as well as teacher !!!!!!

  • @AmiteshSrivastava98
    @AmiteshSrivastava98 5 років тому +9

    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.

  • @johnatteo822
    @johnatteo822 2 роки тому

    Bro why do all these Dev's Do such a great job on these tutorials! Keep up the great work!

    • @WebDevSimplified
      @WebDevSimplified  2 роки тому

      That is exactly what we are doing

    • @johnatteo822
      @johnatteo822 2 роки тому

      @@WebDevSimplified awesome. Just started learning node and I can't believe how much code it takes Just to Authenticate users.. ON FN REAL!! I actually heard php is easier for back-end maybe I should of went that route 😅 🤔

  • @Adefuye
    @Adefuye 4 роки тому +8

    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 ( ua-cam.com/video/vcWsOxmHlpg/v-deo.html ) u will understand everything.

    • @dhruvvit
      @dhruvvit 4 роки тому

      It's not big deal

  • @davidwaine4647
    @davidwaine4647 Рік тому

    Hi Kyle, just wanted to thank you for putting so much energy and accuracy into your work. Lovely to watch and listen to.

  • @achintsrivastava3601
    @achintsrivastava3601 4 роки тому +3

    This guy's face is brighter than my future !!

  • @fyfoh
    @fyfoh 2 роки тому

    This is the cleanest code walkthrough I've ever seen.

  • @Dennis-McTatten
    @Dennis-McTatten 3 роки тому +7

    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 роки тому +1

      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 !

  • @romanmandal6278
    @romanmandal6278 4 роки тому

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

  • @andrei-un3yr
    @andrei-un3yr 4 роки тому +48

    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 Рік тому +3

      Anyone wandering passport local is username password login

  • @apptimegr
    @apptimegr 3 роки тому +1

    I don’t usually comment on UA-cam videos but I need to say that you are an amazing teacher. I watch every single video! Congrats 👏

  • @maxxabillionmaxxabillion8063
    @maxxabillionmaxxabillion8063 4 роки тому +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.

  • @techtantra8360
    @techtantra8360 5 років тому +1

    U r very clear with concepts man. U just know where is error and everything. Keep making tutorials. Good luck!

  • @alphamackie8456
    @alphamackie8456 5 років тому +21

    Hey this video is great! It has helped my understanding greatly, could you do a role based authentication video using mongodb? Thanks very much

  • @saadatsult7031
    @saadatsult7031 4 роки тому

    u helped me so much! i have a deadline today on authentication. your video literally saved me from failure

  • @koloskerekgyarto676
    @koloskerekgyarto676 4 роки тому +5

    Try "app.set('view engine', 'ejs')" if it doesn't work with the hyphen.

  • @jothinayagan.iyyappan
    @jothinayagan.iyyappan 3 роки тому

    Man! Seriously you're seriously super-duper. My number #1 channel is yours. Keep up man. Thanks.

  • @FredWheezy
    @FredWheezy Рік тому +3

    I thought we were making a passport airport login registration portal🤣

  • @bones1225
    @bones1225 4 роки тому +1

    Been in covid lockdown for a couple of months now in SA.
    Loving your tutorials. I have watched most of them. Stunning.
    A lot of rewinding due to that freight-train brain of yours.
    One day, I might pull out my laptop and write my first bit of code at 62years old.
    At the moment just enjoying. Sincerely, ta for the great work.

    • @WebDevSimplified
      @WebDevSimplified  4 роки тому +2

      I am really glad you are finding something enjoyable to do during lockdown! Good luck on your first bit of code. It gets addicting after you start.

  • @someonefromworld8368
    @someonefromworld8368 5 років тому +4

    If you got error when you install bcrypt you can use downgrade version via 'npm i bcrypt@3.0.6'

    • @radoslavsmolen1655
      @radoslavsmolen1655 5 років тому +2

      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 роки тому +1

      Yup, had the same issue! Thanks a bunch!

  • @LongNQW
    @LongNQW 2 роки тому

    Passport js was tough to learn. Used tons of resources, but that video was my main help. Thanks a lot!🙏

  • @jonasrasmussen8067
    @jonasrasmussen8067 4 роки тому +28

    this makes me the good kind of confused

  • @gavinyu6251
    @gavinyu6251 3 роки тому

    Thank you for doing this. You cannot believe how many people you are helping!

  • @MuhammadUsman-rp3ph
    @MuhammadUsman-rp3ph 4 роки тому +5

    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

  • @chinosts
    @chinosts 4 роки тому +1

    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.

  • @wackodreamer
    @wackodreamer 4 роки тому +3

    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 роки тому +2

      I have figured it out

    • @scottregb
      @scottregb 4 роки тому +4

      @@wackodreamer Can you share your solution? I am looking to do the same thing.

    • @bakonyimate796
      @bakonyimate796 4 роки тому

      @@scottregb Me too. Please.

    • @sardendibs
      @sardendibs 2 роки тому +1

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

  • @kenmtb
    @kenmtb Рік тому

    This man is elite. Thank you for taking the time to carefully explain each step.

  • @reubenfernandes3814
    @reubenfernandes3814 5 років тому +3

    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

  • @hexerous
    @hexerous 4 роки тому +1

    He explains it so well you can still learn just by seeing and hearing

    • @p0o9i8z
      @p0o9i8z 4 роки тому +1

      You've got to be kidding. He explained nothing. All he did was to read us his keystrokes as he typed them in. Did he explain why he installed the 'ejs' software, but then never bothered to use it by typing a 'require' statement for it ? No, he didn't. Did he explain how he could check for NODE_ENV === 'production' when NODE_ENV was never initialized to anything at all ? No, he didn't. Did he explain where he got this 'next' function from ? Or did he just grab it out of thin air ? No, he never mentioned that either. He acts like he was born with all of this information in his head, so he doesn't need to explain himself to anyone. Some tutorial.

    • @hexerous
      @hexerous 4 роки тому

      @@p0o9i8z He has explained this is many of his videos. This is not for someone who justs wants to jump into node.

  • @carlonnrivers
    @carlonnrivers 5 років тому +3

    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

  • @rosielmusic
    @rosielmusic 2 роки тому

    Learned more during this video than I have in the last 12 weeks, thank you! 😅

  • @ideashub3608
    @ideashub3608 4 роки тому +3

    Can you help to debug this error on my console = express-session deprecated req.secret; provide secret option server.js :22:9

  • @_benff
    @_benff 5 років тому +2

    This UA-cam channel is a goldmine!

  • @larryklein8307
    @larryklein8307 4 роки тому +3

    Thanks for the video. I keep getting Error: Unknown authentication strategy "local"

  • @devu4240
    @devu4240 9 місяців тому

    Hai. Very clear explanation about jwt. I saw many other videos about jwt.but your video cleared all my doubt about jwt.thank you bro.

  • @iammakimadog
    @iammakimadog 5 років тому +3

    why don't we use the built-in crypto instead of bcrypt

    • @CknSalad
      @CknSalad 5 років тому

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

  • @vadimmanakov7414
    @vadimmanakov7414 4 роки тому +1

    Только зарегистрировался, чтобы оставить комментарий. Отлично и хорошо, что без воды и всё быстро. Спасибо.

  • @heiker4442
    @heiker4442 3 роки тому

    I only suscribe to this channel because the developer is like a hollywood actor. More programmers like you!

  • @exe.m1dn1ght
    @exe.m1dn1ght Рік тому +3

    This is basically an audio version of documentations.. Not explaining any concept at all, just reading like a robot..

  • @zero123824
    @zero123824 4 роки тому

    Thank you . Without your course, maybe I will spend 3 days building such a login pages.
    But now , it only cost 36 minutes !! cool

  • @ahmadalwazzan384
    @ahmadalwazzan384 4 роки тому +23

    Can you still be a web developer if your brain doesn't work half as fast as this guy?

    • @debatrachatterjee2666
      @debatrachatterjee2666 4 роки тому +7

      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 роки тому +1

      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.

  • @larjasoul
    @larjasoul 3 роки тому +1

    The quality of this tutorial is actually insane. Phenomenal work.

  • @tohodakilla
    @tohodakilla 5 років тому +3

    hot content 🔥🔥🔥
    hot host 🔥🔥🔥

  • @alessandramiazato
    @alessandramiazato 4 роки тому +1

    this is really simplified, actually Im appending this login page in the previous node express project that you taught
    thanks!!

  • @joe-un1ky
    @joe-un1ky 4 роки тому +6

    11:20 my man said "ternimal"

  • @jeetuvakode2654
    @jeetuvakode2654 5 років тому

    You are awesome. Finally met someone cool in finishing all stuff easily in UA-cam. Lot's of love 💕.

  • @yuujina7558
    @yuujina7558 4 роки тому +5

    I make the user's data connected with mongodb.
    see it here: github.com/Ilham-Nugroho/login-passport-mongodb

    • @sardendibs
      @sardendibs 2 роки тому +1

      Brilliant, thanks. I spent half a day identifying the error and then trying to fix it. This did it!

    • @suryaprakash787
      @suryaprakash787 2 роки тому +1

      Thanks mate

    • @csengerilevente9564
      @csengerilevente9564 2 роки тому

      Thank you!