Next.js Authentication With Next-Auth V5 Credential Provider

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024

Комментарии • 68

  • @advancereapp
    @advancereapp 2 месяца назад +4

    Thank you, after two days of trying to figure out the credentials provider using the docs and other videos, I finally got it to work with your video. Subscribed.

  • @BrunoAfonsoFernandes
    @BrunoAfonsoFernandes Месяц назад

    This video deserves more than 1 million views. Thank you so much!!

    • @tapasadhikary
      @tapasadhikary  Месяц назад

      Glad it helped.. Thanks a lot. Yo! let's make it happen.. let's go to millions 🚀

  • @musabbirhossain5917
    @musabbirhossain5917 3 месяца назад +1

    Thank you for the tutorial. The way you explain is so helpful and easy to understand.

  • @Rasel720
    @Rasel720 26 дней назад

    You made it so easy to understand ! Love from Bangladesh 🇧🇩 ❤

  • @rakib_pro
    @rakib_pro 3 месяца назад +1

    Just in time! cant wait for the MongoDB integration tutorials.

  • @AliYasir5247
    @AliYasir5247 3 месяца назад +4

    how to do signup using credential provider. like i want username, email, and password

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      Registration process you can keep separate in most cases as I have shown in the video. With credential provider you can do additional prechecks of auth before you register user.

    • @cleverakanimoh
      @cleverakanimoh 2 месяца назад +1

      Just replace the email with username

  • @AK-ln2ko
    @AK-ln2ko 2 месяца назад +2

    Best video on youtube for nextAuth

  • @AvikNayak_
    @AvikNayak_ Месяц назад +1

    The process was so smooth.

  • @shubhamsaini7991
    @shubhamsaini7991 2 месяца назад +4

    Sir, Very helpful video. But I have a very serious doubt
    In V4 we used to return null;
    now in V5 returning null or retuning a custom error; gives a callbackRouteError; why it that.
    Sir I request please clarify this

    • @tapasadhikary
      @tapasadhikary  2 месяца назад +2

      Great question, I explored the same recently.
      V5 has not implemented the same. There are already ongoing discussions I found on their github isssues. The best solution I found so far is to catch the exception in your action and check the type of it. Based on the type, you can rethrow the exception and relevant messages from the action.
      V5 is still in beta so we have to see if there are further updates on this regard. If you also find anything in future, let us know. Lets learn together 🙌

    • @shubhamsaini7991
      @shubhamsaini7991 2 месяца назад +1

      @@tapasadhikary ok thank you sir, i was trying to catch errors thats how I came across your video.

  • @tawsifhaque9360
    @tawsifhaque9360 3 месяца назад +2

    excellent video, many thanks for taking the time to make this video and make it so excellently

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      You're very welcome!

    • @tawsifhaque9360
      @tawsifhaque9360 3 месяца назад

      @@tapasadhikary can't wait for the mongodb integration to store user data in a real database and persist the data instead of using a static file. really excited for that one, and i'm sure that one will be as excellent as well. your videos really help clarify the ideas and make them stupidly simple. much appreciated for the videos sir

    • @tapasadhikary
      @tapasadhikary  3 месяца назад +1

      @@tawsifhaque9360 thanks, man! Make sure you go through my earlier video of persisting data in mongo. It's in the same series.

  • @UdithaTennakoon
    @UdithaTennakoon 2 месяца назад +1

    Nice One :), I would like if you can do basic things also. like step by step guide about NextJs

    • @tapasadhikary
      @tapasadhikary  2 месяца назад

      Thanks! I would suggest you to look into the videos from this playlist from the beginning. Let me know if you find anything missing, would love to add 👍

  • @siamkhushnobish5510
    @siamkhushnobish5510 3 месяца назад +1

    Thanks for making this video for us..
    I am requesting to you if possible make a one video about route protection in next js. Like public route ,private route, restricted route.
    How we protect our route properly?
    Thanks again ❤

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      Yeah… with middleware and a few more ways we can do. Shall make it. Thanks!

    • @siamkhushnobish5510
      @siamkhushnobish5510 3 месяца назад

      @@tapasadhikary Thank you so much! I'm really excited and looking forward to it! ❤️

  • @tusharphb6596
    @tusharphb6596 3 месяца назад +1

    Will be waiting for the next video Dada ❤

  • @Tanzimhossain2
    @Tanzimhossain2 3 месяца назад

    Awesome video and very helpful. Sir, I have a request for you. I need a video on adding callback and multiple middleware to include additional custom fields in the JWT. Include extra fields for the user's role and name upon social media login. We eagerly await these updates.

  • @pranavtripathi4181
    @pranavtripathi4181 16 дней назад +1

    Absolutly amazing.

  • @vlog_with_raj
    @vlog_with_raj 2 месяца назад +1

    How can i receive custom message thrown using throw new Error ( ) method , and how can i display the correct error like password not correct or something else

    • @tapasadhikary
      @tapasadhikary  2 месяца назад

      If you are having a server action, you can always catch them by checking the Error type and rethrow it from the catch block with a suitable error message. Then in your form or invocation point, you can catch the error again and show it on the client side.

  • @julianjupiter5890
    @julianjupiter5890 2 месяца назад +1

    What is that plugin that auto-previews the things to be typed in? Also, what is the editor thene?

    • @tapasadhikary
      @tapasadhikary  2 месяца назад

      For console log or intellisense?

    • @julianjupiter5890
      @julianjupiter5890 2 месяца назад

      @@tapasadhikary intellisense. Ex. while typing in formData variable, it previews the properties email and password.

    • @julianjupiter5890
      @julianjupiter5890 2 месяца назад

      @@tapasadhikary btw, thank you so much for these videos. Last week, I tried to create a small project using NextJS and Auth.js. I stopped it and switched to plain React.js and custom authentication. But just today I was able to make the 3 logins (Google, GitHub & credentials) work. I wished I saw your videos earlier. It motivates me to learn NextJs more. Keep it up!

    • @julianjupiter5890
      @julianjupiter5890 2 месяца назад

      @@tapasadhikary console

    • @tapasadhikary
      @tapasadhikary  2 месяца назад

      That’s tabnine extension

  • @ojomudamola6674
    @ojomudamola6674 2 месяца назад +1

    I want those custom error messages from the authorise function inside auth.js to be rendered in the login client components page

    • @tapasadhikary
      @tapasadhikary  2 месяца назад

      If you are having a server action, you can always catch them by checking the Error type and rethrow it from the catch block with a suitable error message. Then in your form or invocation point, you can catch the error again and show it on the client side.

  • @user-ot9eb3vc2u
    @user-ot9eb3vc2u 3 месяца назад

    Really helful!! thanks. I subscribed and clicked like!

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      Great, and thanks a ton for your support.

  • @sadhondas1512
    @sadhondas1512 3 месяца назад +1

    nextjs a scrapper lib use kora jabe ?
    like puppeteer,
    use kora gele o effective hobe naki ?

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      Definitely you can. Yes it will be useful.. you can create ticket booking apps.

  • @Avijit07x
    @Avijit07x 2 месяца назад +1

    Thank you sir ❤

  • @cleverakanimoh
    @cleverakanimoh 2 месяца назад

    Truly your content is good

  • @dileepa-mn2to
    @dileepa-mn2to 2 месяца назад +1

    in next-auth v5 is there a way to return custom error messages in the authorize function

    • @PauloRdeOFerraz
      @PauloRdeOFerraz 2 месяца назад

      Help!

    • @tapasadhikary
      @tapasadhikary  2 месяца назад

      yes you can but in the action u need to again catch by the error type and rethrow. i explained it one of the comment.

    • @dileepa-mn2to
      @dileepa-mn2to 2 месяца назад

      @@tapasadhikary I go through the comments. But I wasn't able to find it. can you please, comment the link to that answer

  • @irfansaeedkhan7242
    @irfansaeedkhan7242 3 месяца назад

    oo thank you for teaching next auth

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      I am glad when each of my channel subscribers learns.. thank you a lot.

  • @__Gojo___
    @__Gojo___ 3 месяца назад +1

    How can we handle refresh and acces token using credential login?

    • @tapasadhikary
      @tapasadhikary  3 месяца назад

      Have a backend that issues a refresh token and then use the callback handle to manage it. I will show it to Google in an upcoming video and provide guidance on how to do it with credentials following the same. Stay tuned.

  • @ericsiddiq7634
    @ericsiddiq7634 3 месяца назад +1

    Nice ❤❤❤❤

  • @user-hz3mj1mv9v
    @user-hz3mj1mv9v 3 месяца назад +1

    wow

  • @ProgrammerArif
    @ProgrammerArif 3 месяца назад +1

    ✨❤