NestJS Authentication: JWTs, Sessions, logins, and more! | NestJS PassportJS Tutorial

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

КОМЕНТАРІ • 429

  • @mariusespejo
    @mariusespejo  2 роки тому +50

    Note: a lot of people are getting the error “request.isAuthenticated is not a function”. Please note that I explicitly mentioned in the video that it will not work until you properly setup sessions. If you run into that error, KEEP watching! The problem will resolve itself once you have the full setup, don’t stop at the point of error. If you watch the rest of the video and still have this problem, double check that you properly configured and registered your strategies and guards exactly as shown in the video.

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

      in main.ts: below fix it for me
      app.use(passport.initialize());
      app.use(passport.session());

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

      Any chance this can be added as an annotation to the video at that point? I fell into the same trap! Otherwise - awesome video. Keep up the great work!

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

      Not after it’s published sorry

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

      @@mariusespejo Thanks

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

      And maybe something I am missing is some notes about the logout. Currently I am calling .logout() on the request AND calling session.destroy(). Maybe only the last one would be sufficient as it removes the complete session anyways ;-)

  • @sailormetz7148
    @sailormetz7148 2 роки тому +35

    A problem I encountered: if you use argument names other than 'username' and 'password' for local strategy, you must specify them as options in local.strategy in super({ usernameField: 'otherName1', passwordField: 'otherName2' }).
    If you don't, it won't even throw any errors, you'll just keep getting a 401 Unauthorized error. This drove me insane. Hope this helps others avoid this mistake.
    But great tutorial regardless! Content like this makes the internet amazing.

    • @rajuc6438
      @rajuc6438 Рік тому +1

      Thank you so much man. You saved my life!!! It drove me insane for 2 hours. Thanks again

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

      You are my savior, digital Jesus, God in UA-cam. you saved my 8 hours.

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

      Thank you very much, you saved me so much trouble

    • @rumble1925
      @rumble1925 8 місяців тому

      Oof. Thanks bro, I thought I was going insane, not seeing any logs or anything.

    • @osarumenizedonmwen3670
      @osarumenizedonmwen3670 6 місяців тому

      thank you so much bro holy shit

  • @rism8345
    @rism8345 11 днів тому

    Hey Marius, thank you for the clear explanation brother. I've watched this tutorial maybe a 2 or 3 years ago (and instantly subbed of course) when I first wanted to get into NestJS, and now I'm attempting it once again few years later. I followed the docs on authentication and ended up with bunch of files without properly understanding the flow of the authentication. This is exactly what I was looking for in a tutorial: to explain the flow, and you did it perfectly. Appreciate you taking it a few steps further than other UA-camrs and explaining the intention behind the code. I wish your channel success brother.

  • @kinopiskfreepromocode5546
    @kinopiskfreepromocode5546 2 роки тому +12

    The best tutorial i watched so far. Author tells the info clearly and without any useless data. So, i want to say that i was here when the num of followers had been 7k

  • @JorgeFrota-r6w
    @JorgeFrota-r6w 4 місяці тому

    Hey Marius, just passing by to thank you, your video format is awesome.
    I love how you explain everything while showing the documentation. It really adds to us as developers, so that we know like "oh, so the information was here all the time!". It particularly helped me a lot.
    Keep up the good work!

    • @mariusespejo
      @mariusespejo  4 місяці тому

      Thanks man! Glad you found it useful 🙏

  • @mariusespejo
    @mariusespejo  3 роки тому +27

    00:00​ - Intro
    03:35​ - Initial routes
    04:41​ - UsersService
    07:50​ - AuthService
    10:40​ - Implementing passport-local strategy (username/password login)
    18:08​ - AuthGuards
    23:25​ - Summary of local login flow
    29:02​ - Guard to check if user is authenticated
    31:41​ - Setting up sessions
    40:37​ - Summary of login with sessions flow
    44:25​ - Setting up JWT strategy, signing and validating
    1:00:25​ - Summary of JWT strategy flow
    1:04:22​ - Conclusion
    1:05:20​ - Outro

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

      0

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

      req.isAuthenticated gives error ""request.isAuthenticated is not a function" at 29.02 section.

  • @bossmusa9075
    @bossmusa9075 Рік тому +1

    Even today i remember how i asked the question below the similar type of video about jwt and you reply back really fast althought your video was already great. As i see you still answers the questions and its impresive.

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

    That walkthrough at @23:45, priceless!
    So there's actually a guard on the route but you can login with the right body data? neat!!

  • @OetziOfficial
    @OetziOfficial 3 роки тому +5

    Dude, after 4 days struggling you opened my eyes. They should add all of this in their documentation. You are a gold tressure!

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

      It is in their documentation, maybe learn to use the docs? look under security!

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

      @@RajinderYadav I read the documentation first and in the span of 4 days, probably 100 times :D I actually started the project because I loved the documentation, its just on spot, with a few missing parts :)

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

      Docs are definitely very good but it’s not always intuitive to everyone. Simply saying just read the docs is like telling people don’t go to school just read the text books….

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

      I’m been looking for this. Thank you thank you. Would git repo of this code.

    • @h.w.b.9503
      @h.w.b.9503 2 роки тому

      @@RajinderYadav I looked at and read the documentation from Nest and Passport. The main problem for me with the documentation is Nest is all classes and Passport documentation show you how to configure the different strategies in ES6. This video is literally the only resource I've found (and I searched for over a week) that explains that (a) passport is initiated when it is included in the correct provider array and you do not need passport.use() as explained in the Passport docs and (b) the UseGuard is registering the strategy and there is no need for passport.register(), again, as explained in the Passport docs

  • @thecastiel69
    @thecastiel69 3 роки тому +16

    This tutorial I wanted today, what a coincidence

  • @xZunaii
    @xZunaii 3 роки тому +12

    I highly appreciate you going throug the code roughly and also briefly explaining the NPM packages which you're using / recommending. It's really fun coding along and learning in this video!

  • @quamzgraphix9826
    @quamzgraphix9826 Рік тому +1

    your nest js contents are soo good. keep it up marius

  • @Randito33
    @Randito33 4 місяці тому

    Thanks for this tutorial, I went through the NestJS docs a few times and tried to set this up myself but there was always something wrong. Your vid helped me finally get it all working!

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

    Can't thank you enough for this Marius, excellent content, pitched and paced perfectly.

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

      Thank you! I appreciate the feedback

  • @МихаилЧон
    @МихаилЧон 3 роки тому +17

    You are gonna be famous soon

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

    So glad to know that you are following the official NestJs documentation! I also do the same.

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

      Honestly it’s some of the best docs I’ve seen!

  • @FunkyToe369
    @FunkyToe369 3 роки тому +6

    Thanks for spending the time explaining each part and drawing the parallels to his we would do it in express.
    Really helped me understand how to accomplish session auth. Felt a bit lost when the docs only covered JWT auth and all the tutorials I found were showing me the code to make it work... But not why it worked haha

  • @h.w.b.9503
    @h.w.b.9503 2 роки тому +1

    Thank you so much for this tutorial, it helped clear up so much of my confusion. All the examples of different Passport strategies are written using ES6 modules, but the documentation for Nest is with classes. Your video helped translate the difference and finally got my code to work. Very clear and well explained --signed a junior developer that only learned ES6 Javascript in my bootcamp XD

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

    Great tutorial! Very detail and useful. Keep up the good work

  • @asogbaibrahim9618
    @asogbaibrahim9618 Рік тому +1

    I love this tutorial. Clear as Spring water 💯

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

    over separation of concerns. thanks for the tutorial anyway. I don't know why Nest is making everything complicated, yet people enjoying it, frankly.

    • @mariusespejo
      @mariusespejo  Рік тому +1

      Convention over configuration. You learn how to do this stuff once for a nest app, and can probably jump to any other nest app that will mostly be structured the same.
      Try making 5 different devs build the same API using express and they likely will come up with their own patterns and conventions because Express is too flexible/minimal. A large express app can easily become spaghetti. Eventually you realize you need conventions and defined architectures, plus you’d also benefit with adding TS… at which point you might as well just use Nest.
      Alternatives outside express/nest? Yeah there’s a couple. Try comparing the features and their overall ecosystem and you’re likely to find that it’s not as great. But of course YMMV

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

    Best tutorial on NestJs authentication so far. Thanks a lot!

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

    Awesome tutorial thanks, I love that you included regular sessions as well and not ONLY a JWT implementation. Kudos!

  • @manishupadhyay4519
    @manishupadhyay4519 3 роки тому +8

    Thanks a lot Marius! for Authentication session. Very well crafted beautifully explained.
    Just 1 suggestion if you could put this session over git. Would be great to look at the code and get relate it post watching video.
    Keep up the good work!!!
    All The Best!!

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

    Thankss! very usefull. in the last two days, i got Understand this Framework because of you, thank man🙏
    Keep it up

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

    Such a masterpiece bro♥️ everything is perfect in this video 🏳️🙌

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

    Great tutorial bro. It's easy undestandable even to a beginner like me. Nice Job!

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

    Good job Marius, really appreciate your explanation. As I am transitioning to IT side, I find these videos very helpful.

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

      Awesome, I wish you luck on your transition!

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

    Thank you! Very useful. I appreciate your descriptions and of Sessions and JWTs! All the best.

  • @josipkes
    @josipkes 10 місяців тому

    Extremely valuable content, thanks.

  • @thomasdaquinzomahounhele8889

    thank you very much, your work is clear and it is very easy to follow you through the whole video

    • @mariusespejo
      @mariusespejo  Рік тому +1

      Thank you Thomas! Glad you think so!

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

    Absolutely awesome tutorial, thank you so much! Your explanation is very clear and to the point, you're a fantastic teacher! :D

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

    Awesome. Your Tutorials about Nest are the best in UA-cam, even better than in Udemy

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

    Tks once again! You make this easy with yours explanations.. each of details, make a difference.

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

    Thanks Marius your explanation was very clear and with details. This help me to add authentication to my project. Your content is awesome and very complete. Thank you so much for this video. I can't even say how much this content help me. thanksssssssss

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

      I’m glad to help 😄 thanks for stopping by to comment!

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

      @@mariusespejo thanks to you for create this video

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

    Best Nest.js content on YT so far.. Keep up the good work man @Marius

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

      thanks Dev! glad you like the content

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

    this is an excellent video. your explanation is spot on. thank you for taking the time to make these

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

    These video series are awesome! Thank you Marius :)

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

    Another great video Marius!

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

    love your videos dude very clear explanation

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

    Hi Marius, thank you very much for your video. I hope your channel will grow more and more. Have a nice day :D

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

      thanks Badinescu! glad you’re finding the channel useful!

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

    Great video! It helps me a lot, thank you!

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

    Thank you for all these NestJS tutorials they are really helpful!

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

    Very useful info. Thank you for the patient and detailed explanation.

  • @vanshdubey21
    @vanshdubey21 7 місяців тому +1

    VERY VERY HELPFUL VIDEO

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

    I appreciate what you did for community

  • @kurtestacion6113
    @kurtestacion6113 3 роки тому +16

    Can you do more of nestjs with graphql like auth and/or microservices. That would be a unique content!

    • @mariusespejo
      @mariusespejo  3 роки тому +12

      will definitely look into that more, I’m still learning a lot of the best practices with graphql myself

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

      second that

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

      @@mariusespejo Can't wait to learn that combination from a master like you

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

      hey folks, just following up: new video just posted on doing this same auth topic but in graphQL specifically

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

    It would be terrifically useful if you would build the client side login flow that connects with the JWT strategy. This tutorial was really clear and concise.

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

      Thanks, will consider it! For the most part the client-side is really just all about managing/storing that jwt somewhere and making sure it’s included in the headers of each request to your API. I’ll try to make a video about it sometime.

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

    You are awesome! You cleared some very problematic issues for me. Thanks

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

    There are so many classes you have created. It is good for separation of concern as you said. There should be a slide to explain the flow of uses of those classes. Ex: Class A used by Class b and Class b used by Class C. This will make it very easy to understand to the viewers.

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

      Everything in nestjs is a class, don’t over think it, each one has a given purpose which you can usually easily determine by naming conventions, e.g. guard, controller, strategy, service, etc.

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

    Your effort is highly appreciated, Marius. Very helpful thanks!

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

    Awww yiss another Marius Espejo Nest vid 🔥

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

    Thanks for your content Marius. They are immensely helpful.

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

      I’m glad! thanks for stopping by to comment

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

      @@mariusespejo THANK YOU 😎👍🏾

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

    Thanks, @Marius! The video is so helpful, I really learnt a lot.

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

    Excellent tutorial and better explanation!

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

    This was IMMENSELY helpful. THANK YOU!

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

    Thanks a lot man, that was a super good material for me. Hope u will get the best in this life, good luck!

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

    Really really good fundamental tutorial!!!!
    thanks

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

    Great vid Marius we expect more 👏👏

  • @vincent-thomas
    @vincent-thomas 3 роки тому

    This was soo good! Please post (pun intended) a video where you handle sign up and remove account!!!

    • @vincent-thomas
      @vincent-thomas 3 роки тому

      With JWT!

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

      Thanks! Will consider a specific video on that topic. Not really much to it though, sign-up is basically almost the same as login, but obviously you’d be adding to a db table of users, and removing is simply deleting that record

  • @리린-q9f
    @리린-q9f 3 роки тому

    Thank you so much for making this video! I loved it 😍

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

    This was awesome!

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

    Very height quality content! Thanks Marius.

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

    Awesome, please continue ;)

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

    Your background image is the hero image of my portfolio lmao

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

    Clean and clear , great tutorial...

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

    This was definitely very useful. Thank you so much 😁

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

    thank you so much for this tutorial!

  • @seal0118
    @seal0118 2 місяці тому

    why do not provide guards in the auth module? are they provided internally by nest?

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

    Thank you so much for this tutorial

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

    Very understandable. You helped me, thanks :)

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

    Thank you for your effort!

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

    Great video thank you!

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

    I looking for this same but with graphql, good video my friend, it will help me

  • @hasst9261
    @hasst9261 8 місяців тому

    Cool content
    Rly helpful
    Ty!

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

    Yes, another awesome awesome videos,

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

    thank you marius, your are awesome

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

    you did amazing job. plz tell one thing. how to implement authentication on microservice based architecture

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

      That’s a bit of a loaded question that is not simple to answer in a comment. First of all there are several strategies that depends a lot on your infrastructure, your identity provider, etc. Next the “how” again will depend on the strategy. I suggest spending some time reading about it

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

    Hi, Marius I got a question, why the method validate that in JwtStrategy return the object coordinates to req.user at 1:02:42?
    Thanks 🙏

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

    Thanks for the great video!

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

    Thanks for your video, i loved!!!

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

    Hello, I have covered the first 30 minutes of the video, I keep getting this when using postman TypeError: Cannot read properties of undefined (reading 'validateUser'). I do not find the error, I have checked the documentation

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

      That’s implemented in the AuthService around 7:50. Did you actually implement validateUser? Is it in the correct service?

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

    Great one 👌 Thanks

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

    Marius the Genius....#Legend

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

    Thanks, great explanation.

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

    hi marius, in AuthenticatedGuard file i get error which is "request.isAuthenticated is not a function". may i know why i get that ?

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

      You likely didn’t setup the local strategy and its guard correctly

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

    Thank you, I faced some issues with the session method, I got an internal server error response and the app crushed, am not sure how to fix it.

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

      I would recommend looking at express-session docs make sure you didn’t misconfigure

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

    Very good job , Thanks a lot!

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

    30:38 I have error: "request.isAuthenticated is not a function", how can I handle that?

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

      Did you fully setup sessions?, make sure to follow what comes after that timestamp

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

      @@mariusespejo yep, I followed you and installed full setup you had installed

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

      @@mariusespejo Same Error, Please Explain

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

      Please double check that you have the LocalAuthGuard written properly as shown in 18:37
      In general that method specifically comes from passport, so if it can’t see that it exists you’re not wiring up passport or the guards correctly

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

    Hi guys, i am stuck in the chapter guard to check if user is logged in. It is an error said "request.isAuthenticated()" is not a function. I console log the keys of request object and realize that the object dont have the isAuthenticated isUnauthenticated ,user. Any suggestion guys ?

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

      It likely means either the guard or the strategy were not registered or configured correctly

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

      @@mariusespejo i have checked every step very clearly but can not figure out which step that i missed. Googling for days and have no hope man. The local strategy work as the video. But the authenticatedGuard implements CanActive not working. Do you have any idea for it ?

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

      Are you sure you registered your strategies as providers in the module?

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

      Did you actually setup sessions? Please note that in the video I explicitly said the guard won’t work until you actually have the sessions in place. That along with actually having the full passport local strategy working and correctly registered is what’s needed. Make sure to watch the rest of the video and don’t just stop at the point of error

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

      @@mariusespejo My bad.that is the missing piece . i have finished following your tutorial. that really helpful . thanks for your answer and making such a good video. have a nice day

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

    Why people are using sessions? In both approaches the client side must securely save the “cookie” or the “jwt token”. The main difference is that in case of the JWT approach the server does not need to maintain a DB of sessionId for lookup

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

      It’s a matter of where you want to store the session…. In a store or in jwt… note that if you have a lot of data for your user session having all of that in a jwt/cookies would be impractical, that’s just extra data you’re sending over the wire. So it depends on the use case. Also server-side sessions are significantly more secure in my opinion, you don’t have to worry about tokens being intercepted (which again will have some user data on it)

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

    req.isAuthenticated gives error ""request.isAuthenticated is not a function" at 29.02 section.

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

    What are the reasons you chose React over Angular? knowing nestjs is literally angular but backend ?

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

      pick tools based on what you believe is best for the task, not based on similarities.

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

    Love your videos, thank you for help.

  • @Bryan-bh7cy
    @Bryan-bh7cy 2 роки тому

    you are a legend

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

    can i change the serializer service anme to CookieSerializer ? how passport know where to look for this functions of serial/deserial ?

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

      Im not sure that the name matters as long as it is extending PassportSerializer and that you’re registering it as a provider, Nest automatically calls it by convention when you’re using sessions with passport

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

    Can you please make a complete authentication tutorial with nestjs and react? Love the nest videos.

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

      will definitely consider it!

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

      @@mariusespejo thanks for this video Marius
      i'm studying jwt Login authentication with nest.js, react too.
      complete authentication tutorial(refresh token, logout ...stuffs) will be very helpful for me
      I want you to refer to making a video for this.
      Thanks!

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

      @@mariusespejo Love your tutorials, man.

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

    Thank you so much for your effort making this!

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

    Hi! Just a question, in 6:45 you are returning an object not a promise even though you especified that in the method signature. Is that syntactically valid?

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

      The method itself is async so anything it returns is implicitly wrapped in a promise. I recommend reading about async/await if you’re not familiar. Also note that since we’re using typescript here if the return types don’t match it should let you know

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

      @@mariusespejo Oh Thank you so much! BTW I like the way you explain, even for a newbie like me is easy to follow xD!

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

      Thank you glad to hear 😄

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

    Nice would be part 2 with refresh token. Tanks for video. ( I m from Erick )