Better auth tutorial for next.js | Best authentication framework for next.js

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

КОМЕНТАРІ • 34

  • @AdityaSinghCodes
    @AdityaSinghCodes  21 день тому +2

    Hey guys. In the video navbar is a server component which depends upon request time information to get the session. This causes all the routes to become dynamically rendered. To fix this, just convert the navbar component to a client component and access session on the client side. I already pushed the code to github repo.
    Thank you @codezyraofficial for pointing this out.

  • @abtonc
    @abtonc 28 днів тому +5

    Hi Aditya, great video. I would recommend adding timestamps/sections. Algorithm will boost the video and it would help people find what they are looking for.

  • @thowheedh
    @thowheedh 28 днів тому

    Brother you deserve millions subs

  • @codesavanna
    @codesavanna 18 днів тому

    thank you so much you are such an amaizing teacher 😃

  • @kambaalayashwanth123
    @kambaalayashwanth123 26 днів тому

    Thank you for the video,been working on better-auth,it decent.
    Please make more on organisation or multi tenet if possible

    • @AdityaSinghCodes
      @AdityaSinghCodes  25 днів тому

      Awesome. Multi-tenancy is a good idea. I will create a video on this along with custom domain and ssl certificates.

  • @uditmehra80
    @uditmehra80 28 днів тому

    Neat and clean explanation as always 🎉

  • @viper_eyes
    @viper_eyes 22 дні тому +1

    Greate video but just one thing to add , you can use the useSession hook to get the session in client components without the need for a server component , it is wrong in their docs to mention the await auth.api.useSession while it is mentioned in the nextjs integration on client components you can just call the useSession hook which run fine in the client the only caveat is that this will get the seesion is the user logged in also on client side , but if the user logged in server side (eg.server action ) the session will be null .

  • @mutantmantish6141
    @mutantmantish6141 17 днів тому

    Nice vid

  • @prashlovessamosa
    @prashlovessamosa 29 днів тому

    Thanks for sharing I am using it it's so easy to implement.

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

    better-auth much better then next-auth

  • @ivango1182
    @ivango1182 5 днів тому

    how do i verify if a user has an account in my client side before i sent the reset password link email? i keep getting the success message eventhough i enter a non existing account

    • @AdityaSinghCodes
      @AdityaSinghCodes  5 днів тому

      It is only going to send reset password email if the email exists in your db

    • @ivango1182
      @ivango1182 5 днів тому

      @ ya but i am getting the success toast message without reset password link even the account doesn't exist, my concern is about the toast message, how do I control it

    • @AdityaSinghCodes
      @AdityaSinghCodes  5 днів тому +1

      I have not tried this, but try looking in the data when you call forgetPassword. const { data, error } = await authClient.forgetPassword(yourOptions);

  • @pradhumanshrestha5479
    @pradhumanshrestha5479 22 дні тому

    Nice video but can you help me to handle error when account linking is false.

    • @AdityaSinghCodes
      @AdityaSinghCodes  22 дні тому

      what error are you getting ?

    • @pradhumanshrestha5479
      @pradhumanshrestha5479 22 дні тому

      @@AdityaSinghCodes I am getting oauth error message like account is already used in other provider. When I try to log in browser console. Its empty. Can you help me how can I display it in client side.

    • @AdityaSinghCodes
      @AdityaSinghCodes  22 дні тому +1

      You will get the error info in the query param. Read from there and show the user on the client side.
      localhost:3000/sign-in?error=account_not_linked

    • @pradhumanshrestha5479
      @pradhumanshrestha5479 21 день тому

      @@AdityaSinghCodes thanks for help..

  • @owl3379
    @owl3379 10 днів тому

    idk, i get 401 unauthorized as admin :(

  • @ricko13
    @ricko13 23 дні тому +1

    oh man, this video could really be shorter if you didn’t overcomplicate every simple thing

    • @AdityaSinghCodes
      @AdityaSinghCodes  23 дні тому

      Hi, thanks for your comment! I try to give enough context while keeping things clear, and most viewers like this approach. I know my videos won’t suit everyone, and that’s okay. If you have specific suggestions, let me know. Otherwise, feel free to check out other content that fits your style better. Thanks for watching!

  • @uditmehra80
    @uditmehra80 29 днів тому

    Actually m confused b/w next-auth and better-auth which one is best ?? What do you think?

    • @Henok-qn6nc
      @Henok-qn6nc 28 днів тому +2

      Better Auth all the way

    • @remember.772
      @remember.772 28 днів тому

      Anchi mirt 🎉​@@Henok-qn6nc

    • @prashlovessamosa
      @prashlovessamosa 28 днів тому +1

      @@Henok-qn6nc open auth is comparatively very new if you working with hono or something else stuff is not there but it's very easy to implement or I can say free clerk

    • @Henok-qn6nc
      @Henok-qn6nc 28 днів тому +1

      ​@@prashlovessamosa It is new. But Its also stable and ready to use on prod. And there is hono integration guide on the documentation. Check that out

    • @prashlovessamosa
      @prashlovessamosa 28 днів тому +3

      @@Henok-qn6nc I am sorry I had no idea about that I will check 👍