Node Auth Tutorial (JWT) #5 - Mongoose Validation

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ม.ค. 2025

ความคิดเห็น • 111

  • @mandihaase2744
    @mandihaase2744 3 ปีที่แล้ว +23

    PLEASE keep making courses! I would love a full stack course using React and Express, with either PostgreSQL or MongoDB. Your teaching style is one of the best I have found!!

  • @Nautiklez
    @Nautiklez 9 หลายเดือนก่อน

    Thank you for the "long winded" explanation of how you came to getting the errors out of the object. That was extremely helpful for me in understanding what exactly is going on.

  • @Olejoss1906
    @Olejoss1906 ปีที่แล้ว +2

    Errors handling explanation was simply outstanding. After this episode I'm certain if I was about to buy a course from you, that would be greatly invested money.

  • @fevicoI
    @fevicoI 4 ปีที่แล้ว

    this is amazing the way he explains something as simple as error handling in depth is just remarkable.

  • @shantanu9393
    @shantanu9393 4 ปีที่แล้ว +25

    The Net Ninja : I can do this all day!

  • @_rachid
    @_rachid 4 ปีที่แล้ว +3

    This lecture is gold. Thank you Shaun!

  • @chiragkhandelwal9178
    @chiragkhandelwal9178 4 ปีที่แล้ว +3

    This guy aint gonna stop and i love it

  • @astrix8812
    @astrix8812 3 ปีที่แล้ว +3

    I got to learn so much from this video! My mind has been blown. This is soo good, thank you very much ninja I really like how you clear things up so easily :)

  • @hristoplamenov1942
    @hristoplamenov1942 4 ปีที่แล้ว +3

    Nice tutorial!
    Just to point out - you can achieve the same way of functionality (model definitions, validation etc.) with Sequelize and MySQL (if you need to work with Relation database). The tutorial still applies for this "configuration" as well.

  • @aryagoswami4152
    @aryagoswami4152 4 ปีที่แล้ว +3

    As always, the master is back rocking, this time with JWT! Eagerly looking forward..........

  • @destinlee
    @destinlee 4 ปีที่แล้ว +4

    This is the first video of yours where I can hear you typing. I thought someone was knocking on my front door. I, no joke, got up and checked hahaha

  • @ashongabdalla5940
    @ashongabdalla5940 7 หลายเดือนก่อน +1

    Brilliant and straightforward explanations. I could feel this is a hard topic and yet still you've made me understand pretty much everything that's going on. Maybe there's a little more practice needed to grasp it entirely. Thanks

    • @NetNinja
      @NetNinja  7 หลายเดือนก่อน +1

      Glad it was helpful! :)

  • @alexberdea
    @alexberdea ปีที่แล้ว

    Ughhhhh what a steal, Properties destructuring in the foreach .. zbagliato. Stunning

  • @duke_hammersmith_iii
    @duke_hammersmith_iii 4 ปีที่แล้ว +1

    What a properly brilliant tutorial/course. I'm loving it.

    • @NetNinja
      @NetNinja  4 ปีที่แล้ว

      Thank you! :)

  • @ul-kaem-ka8094
    @ul-kaem-ka8094 ปีที่แล้ว

    None explain better than you. You're an absolute star!

  • @shimmerz555
    @shimmerz555 2 ปีที่แล้ว

    errors[properties.path] = properties.message is a very smart way of dealing with it. i was a bit mindblown

  • @osamamughal2707
    @osamamughal2707 ปีที่แล้ว

    Mongoose Validation video was really awesome , Thanks once again

  • @jomarkpangan9362
    @jomarkpangan9362 4 ปีที่แล้ว +1

    Wow.. didn't know you can use validation in mongoose. I always used 3rd party whenever I create apis. thanks shaun!

  • @sujeet4410
    @sujeet4410 4 ปีที่แล้ว

    loving this series.

  • @stevenlee1726
    @stevenlee1726 4 ปีที่แล้ว

    Net Ninja bro, thanks for the tut. You are so great at teaching. Give you 1000 like. This thing deserve million views

  • @subhanmaulana8135
    @subhanmaulana8135 ปีที่แล้ว

    U're genious, shaun!

  • @nabeeljaved1742
    @nabeeljaved1742 4 ปีที่แล้ว +5

    I am excited to see how shaun will use jwt token to use from front end. Will you save in localstorage, session or cookies i cant wait man for that part.. rest nice one man.

  • @kervmeister69
    @kervmeister69 4 ปีที่แล้ว +1

    Binge watching your react js tutorials... Thank you for this 👍☕☕☕

  • @awaisraza2285
    @awaisraza2285 4 ปีที่แล้ว

    Here you go

  • @erick_la
    @erick_la 4 ปีที่แล้ว +1

    Thanks Shaun for the great video :D

  • @venkateshvellingiri7188
    @venkateshvellingiri7188 4 ปีที่แล้ว

    Nice explanation about errors and mongoose validation. 👍

  • @Vue-daigle
    @Vue-daigle 4 ปีที่แล้ว +1

    Thks Shaun for these great videos ! Smooth, precise and clear. (=

  • @userj-s2000
    @userj-s2000 ปีที่แล้ว

    This chapters basically explained that its enough internet for today :D

  • @AnsBdran
    @AnsBdran ปีที่แล้ว +1

    shouldn't the email syntax validation and password length and these thing be validated at the front end?

  • @moziadalhafez3851
    @moziadalhafez3851 4 ปีที่แล้ว

    thank you bro , your tutorials is very useful ❤

  • @onoseogbidi3830
    @onoseogbidi3830 10 หลายเดือนก่อน

    Thank you so much for this life changing video

    • @NetNinja
      @NetNinja  10 หลายเดือนก่อน

      You're so welcome! :)

  • @alamir411
    @alamir411 2 ปีที่แล้ว

    you are a HERO

  • @MrSalFav
    @MrSalFav 2 ปีที่แล้ว

    Amazing tutorials great job thank you!!

    • @NetNinja
      @NetNinja  2 ปีที่แล้ว

      Thanks for your support Saleem :)

  • @shadmanmartinpiyal4057
    @shadmanmartinpiyal4057 4 ปีที่แล้ว +2

    "Node Auth tutorial with JWT plus a crash course on MongoDB & Node" :'D

  • @darklord9500
    @darklord9500 ปีที่แล้ว

    Very nice tutorial!

    • @NetNinja
      @NetNinja  ปีที่แล้ว +1

      Thank you!

  • @prabss3444
    @prabss3444 4 ปีที่แล้ว

    Great series! Thanks.

  • @sauravjain6135
    @sauravjain6135 4 ปีที่แล้ว +1

    90% to yaha Indians hi hai...👍👍👍

    • @shantanu9393
      @shantanu9393 4 ปีที่แล้ว

      Did he understand it?😂

    • @sauravjain6135
      @sauravjain6135 4 ปีที่แล้ว

      Yes

    • @ChandanKumar-of1je
      @ChandanKumar-of1je 3 ปีที่แล้ว

      Ghanta 90% instead 20 - 30% hoga buss, because we are indians whole day === shit tiktok

  • @bikabas
    @bikabas 4 ปีที่แล้ว

    Looking forward to the next video

  • @عليسعد-ح3ك5ذ
    @عليسعد-ح3ك5ذ 5 หลายเดือนก่อน

    Hi , great video ! but I have a simple problem which is when I have invalid email and password like you did in the first 10 minutes , I have a validation for just the email . why is that

  • @prafulrane3591
    @prafulrane3591 ปีที่แล้ว

    What should I do next
    Can you make a pathway video to know how should we follow your playlist from your channel for every technology covered on your channel?

  • @DiamondBroPlayz
    @DiamondBroPlayz 2 หลายเดือนก่อน

    You can add this to the password json to require numbers in the password:
    validate: [(val) => {
    return /\d/.test(val);
    }, "Please make sure your password contains at least one number!"]

  • @andromilk2634
    @andromilk2634 9 หลายเดือนก่อน

    Doesn't returning from the duplicate email error imply that even if the user had a invalid password, he would never be notified of this at the same time as the duplicate email error? In other words, he would have to resolve the email error before being able to see the password error? Also, a bit of a beginner question : when you destructured the properties property, why is it that it was asking you for parentheses? Shouldn't the curly braces by themselves suffice or is there something which I'm missing? Thanks

    • @ashongabdalla5940
      @ashongabdalla5940 7 หลายเดือนก่อน

      I think it's because JS will think { properties } is the start of the **what to do for each** function. Placing it in a parenthesis means, it will interpret it as a placeholder for each item. Hope this makes sense.

  • @damiangowala5681
    @damiangowala5681 4 ปีที่แล้ว

    Shaun, will you include refreshing the JWT token the right way? It is often skipped in many tutorials.

  • @abdulkadirguven1173
    @abdulkadirguven1173 2 ปีที่แล้ว

    Great content. Thanks a lot.

  • @kiranpawar2463
    @kiranpawar2463 4 ปีที่แล้ว

    Thanks for great video ✌🤟🤞

  • @cubedev4838
    @cubedev4838 3 ปีที่แล้ว

    Hello shaun, can u make a live video how you study something like new tech?

  • @mezbaulabedinforhan2104
    @mezbaulabedinforhan2104 2 ปีที่แล้ว

    The method is really awesome !!!! Loved it . 💌from Bangladesh !!💌

    • @NetNinja
      @NetNinja  2 ปีที่แล้ว +1

      Thank you! Cheers! :)

  • @StarBattle08
    @StarBattle08 4 ปีที่แล้ว

    what about using Joi for validation?

  • @loveChroniclesTv
    @loveChroniclesTv 4 ปีที่แล้ว

    I think this videos are coming quicker than bullets. I need notebook to catch except later. Thanks.

  • @menandmice
    @menandmice 4 ปีที่แล้ว

    Expert stuff!

  • @jitendratrivediietlucknows391
    @jitendratrivediietlucknows391 2 ปีที่แล้ว

    How to validate if type is object instead of string?

  • @rogerccaqp
    @rogerccaqp 4 ปีที่แล้ว

    Nice video. In case of mobile devices.
    How u prefer manage about security and authentications.
    U think that its better that user can "correct authenticactions " in many devices
    or Only one device, like one session at a time
    User can login in multiple devices at same time or only the last authenticacion is correct?

    • @K-IA
      @K-IA 4 ปีที่แล้ว +2

      That depends on your requirements.
      if you need to be able to login from multiple devices, then store the token and device information so that the user can check their sessions. Otherwise overwrite their token with a new one each login.
      One login token is of course more secure just because there is less devices to worry about.

    • @rogerccaqp
      @rogerccaqp 4 ปีที่แล้ว

      @@K-IA thank u man,
      I think the 1st case its ok with sessions data register like device time and location

  • @anishjoshi1999
    @anishjoshi1999 4 ปีที่แล้ว

    you are my hero!!

  • @jyotirmoydeb5263
    @jyotirmoydeb5263 3 ปีที่แล้ว

    Can you also mention in a video on how to confirm password

  • @Geek_God16
    @Geek_God16 8 หลายเดือนก่อน

    explanation is lit

  • @kavindesivalli
    @kavindesivalli 4 ปีที่แล้ว

    We are so lucky that we are getting this for free

  • @bakercsgo5822
    @bakercsgo5822 ปีที่แล้ว

    that went from 0 to 100. everything made a lot of sense until the error handling. then it just felt like mumbo jumbo and following along

  • @josephjohn7360
    @josephjohn7360 4 ปีที่แล้ว

    Hello shaun, i'm joseph and i really want to learn programming and i saw your beginners html and css course and i love them and i was thinking of watching all your videos from the very first to now but i'm also thinking its a waste of time and i should just start with the modern once like the html crash course or the angular 2 instead of angular js i just really need to hear from you so pls reply i'm desprate thank you

    • @NetNinja
      @NetNinja  4 ปีที่แล้ว

      Hey, thanks :). Yeah some of the modern ones might be a good choice. I would maybe suggest a responsive build one, and also things like css grid. Angular is more advanced so I would definitely learn javascript first. I have a modern javascript playlist on here as well for that plus lots of others :)

  • @liferc
    @liferc 4 ปีที่แล้ว

    i thought ur gonna use bcrypt to hash password. Well now im looking forward to see mongoose hooks

  • @falcon03822
    @falcon03822 4 ปีที่แล้ว

    Object.values()not working how to resolve it??

  • @JustEngllish
    @JustEngllish 4 หลายเดือนก่อน

    Sorry, but shouldn't there be validation checks on the client? Otherwise, on the server with such checks, the response loads in more than 100 milliseconds, and that's bad.

  • @jumbo999614
    @jumbo999614 4 ปีที่แล้ว

    Anyone gets "User validation failed" with capital 'U'? .includes(' ') is case-sensitive. It took me awhile to figure why the code didn't work.

  • @fredpourlesintimes
    @fredpourlesintimes 3 ปีที่แล้ว +1

    It's an interesting part, but it's not very clean...
    The way to manage with errors is a bit of tinkering.

  • @pablofonseca8867
    @pablofonseca8867 4 ปีที่แล้ว

    I made this function for handle errors, I think is more dynamic.
    const HandleErrors = (err) => {
    const errorList = {};
    if (err['code'] != undefined) {
    for(let x in err){
    const keyValue = Object.keys(err['keyValue'])[0];
    if(err['code'] === 11000){
    errorList[keyValue] = `There is an user with the ${keyValue} repeated.`
    }
    }
    } else {
    const errorJson = err['errors'];
    for (let x in errorJson) {
    errorList[x] = errorJson[x]['properties']['message'];
    }
    }
    return errorList;
    }

  • @crofux
    @crofux หลายเดือนก่อน

    That validation is causing the mongoose in a loop:'

  • @geraldmacias7037
    @geraldmacias7037 4 ปีที่แล้ว

    fuck, I LOVE THIS GUY

  • @gigabytegame9860
    @gigabytegame9860 4 ปีที่แล้ว +1

    Dude you're awesome. You motivated me to do code 😜. I've been thinking a lot about auction site. Could you make a tutorial about a simple auction? It would be cool

  • @khaidemsandip4151
    @khaidemsandip4151 3 ปีที่แล้ว

    a mern course please

  • @gowthameswaran1769
    @gowthameswaran1769 3 ปีที่แล้ว +3

    unique: true is not working

  • @sahajkedia6051
    @sahajkedia6051 4 ปีที่แล้ว

    When's the next vedio coming???

  • @bijayaadhikari442
    @bijayaadhikari442 4 ปีที่แล้ว

    mongoose hooks to hash password as pre,save. I really didn't grasp that early on. What about passportjs to hash.

    • @TechnoDB
      @TechnoDB 4 ปีที่แล้ว

      I guess : mongoose hooks with bcrypt

    • @bijayaadhikari442
      @bijayaadhikari442 4 ปีที่แล้ว +1

      @@TechnoDB yes bcryptjs, ani bro Android rooting ko video sai thiyo.

    • @TechnoDB
      @TechnoDB 4 ปีที่แล้ว

      @@bijayaadhikari442 : hehe.. Thank you bro.
      tyo video 2/3 years huna laagexa aba ta ))

    • @bijayaadhikari442
      @bijayaadhikari442 4 ปีที่แล้ว +1

      @@TechnoDB yap, I analysed that you have good explaination and voice. You should try an application from frontend to backend as you learn.

    • @bijayaadhikari442
      @bijayaadhikari442 4 ปีที่แล้ว

      I mean making video.

  • @pchchv
    @pchchv 3 ปีที่แล้ว

    I found a little bug. If you set a duplicate email and a short password, only the password error will be handled

    • @nagame859
      @nagame859 ปีที่แล้ว

      yup!
      coz validation occurs before going to the database!!

  • @khalidkhan5308
    @khalidkhan5308 4 ปีที่แล้ว +1

    It would be great if you could use (www.npmjs.com/package/joi) JOI validator instead

  • @SENPAI-mi6sz
    @SENPAI-mi6sz 2 ปีที่แล้ว

    const errors = {};
    for (key in error.errors) {
    const { message } = error.errors[key];
    errors[key] = message;
    }
    res.json(errors);
    console.log(errors);

  • @himesh_89
    @himesh_89 4 ปีที่แล้ว

    thanks

  • @dashataranfa
    @dashataranfa 4 ปีที่แล้ว

    imba mode

  • @ridl27
    @ridl27 4 ปีที่แล้ว

    ty.

  • @martinp.617
    @martinp.617 4 ปีที่แล้ว

    Salamat..,

  • @dineshghantasala128
    @dineshghantasala128 4 ปีที่แล้ว

    I guess its goodbye to @hapi/joi

  • @RexGalilae
    @RexGalilae 4 ปีที่แล้ว

    Is it just me or did Shaun just go trigger happy with his error message function midway through the video?

  • @-Abdullah1
    @-Abdullah1 3 ปีที่แล้ว

    👍👍

  • @mabroorahmad2182
    @mabroorahmad2182 4 ปีที่แล้ว

    Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic
    💖💖💖💖💖💖💖💖

  • @GrinFlash007
    @GrinFlash007 2 ปีที่แล้ว

    Too complex!

    • @MercurySteel
      @MercurySteel 4 หลายเดือนก่อน

      Skill issue

  • @fevicoI
    @fevicoI 4 ปีที่แล้ว +4

    this is amazing the way he explains something as simple as error handling in depth is just remarkable.