I fixed Next Auth!!! Credentials Login with Database Strategy - Next Auth - Auth Js - Next Js

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

КОМЕНТАРІ • 40

  • @abdullahdoganay6980
    @abdullahdoganay6980 3 місяці тому +6

    Your work is incredibly valuable. I'm not sure what more I can do for you than liking this video.

    • @ugurcodes
      @ugurcodes  3 місяці тому +3

      thanks! don't make it a big deal just one cup of coffee/tea would be fine at Paper..

  • @rosalesgonzalezangeljonas2965
    @rosalesgonzalezangeljonas2965 Місяць тому +1

    Thank you men, Im crying, it just works

  • @parthparmar9798
    @parthparmar9798 Місяць тому

    you solved the problem i was battling for more than a week. YOU ARE GREAT

  • @rxnniiee
    @rxnniiee 3 місяці тому +2

    glad to see you tackled the issue I brought up in one of your videos about next-auth, though I will still be using lucia for the control it gives me, plus there's seemingly no way to disable the built in login / signup pages provided by next-auth, which I find very annoying

    • @unknownguywholovespizza
      @unknownguywholovespizza 3 місяці тому

      You can customize the pages

    • @rxnniiee
      @rxnniiee 3 місяці тому +2

      @@unknownguywholovespizza no way to disable, though

  • @kakun7238
    @kakun7238 3 місяці тому +2

    please make a full stack app tutorial with the best practices and handling the edge cases as well most of the tutorials dont do that

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

    Hi, thank for these videos it really help a lot.
    I was doing the same thing but it’s throwing errors now. and also auto deleting cookie after login

  • @Mrbrandon804500
    @Mrbrandon804500 2 місяці тому +1

    Be aware because you send the password in the data when using useSession in the frontend , juste handle in the session callback if(session.user.password){ delete session.user.password), I know it send the encrypted password but it's important

  • @nilsgoeke7494
    @nilsgoeke7494 27 днів тому

    This is exactly what I need!

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

    Great work! It helped me a lot, thank you!

  • @ĐặcCầu-l8m
    @ĐặcCầu-l8m 11 годин тому

    I didnt see your middleware, how did you protect your route ?

  • @mehmethanifierenler3612
    @mehmethanifierenler3612 3 місяці тому +2

    Teşekkür ederiz. Next.js 15 Drizzle Postgresql NextAuth bunlar çok gözde konular. 1,5 yılda epey beğeni toplar. Bir seri olarak düşünürmüsün mesala bu konuları ?

    • @ugurcodes
      @ugurcodes  3 місяці тому

      Rica ederim. Olur isterim, 15 çıktığında böyle bi seri yapabilirim aslında

  • @destocot1729
    @destocot1729 Місяць тому

    this was pretty helpful, my issue is if i just do credentials provider without any oauth providers i get an annoying error in the console always "credentials not supported with database strategy"
    it still works but the error is so annoying, you know any way to avoid it?

  • @ogbillity
    @ogbillity 3 місяці тому +1

    Thank you so much. Can you add role based authorization

  • @destocot1729
    @destocot1729 Місяць тому

    Also, if I use the Prisma Adapter or Drizzle Adapter with database strategy I cannot use middleware? is there anything I can do about that?

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

    The log out seems not deleting the session from the database. Any clue?

  • @howtocode2296
    @howtocode2296 3 місяці тому

    if you read the next auth documentation, there is a session strategy jwt
    ....

    • @ugurcodes
      @ugurcodes  3 місяці тому

      @@howtocode2296 can it be used with social providers though?

    • @howtocode2296
      @howtocode2296 3 місяці тому

      @@ugurcodes i still not yet trying for the social providers. perhaps separate the auth config too

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

    I wonder, how does someone use this way to do RBAC and is it possible to use with middleware?

  • @eliassmith7949
    @eliassmith7949 3 місяці тому

    why do you store in db access_token and refresh_token?

  • @siddhantota2224
    @siddhantota2224 3 місяці тому +1

    Thanks mate

  • @mehmethanifierenler3612
    @mehmethanifierenler3612 3 місяці тому +1

    Be careful! The redirect_uri is not associated with this application. Hatasının sebebi ne olabilir. credentional da normal çalışıyor github ta hataveriyor

    • @ugurcodes
      @ugurcodes  3 місяці тому +1

      export async function loginWithGithub() {
      await signIn("github", {
      redirect: true,
      redirectTo: process.env.NEXT_PUBLIC_BASE_URL,
      })
      }
      eğer bu kod parçasını kullanıyorsan, .env dosyanda NEXT_PUBLIC_BASE_URL 'ın tanımlı olmasına dikkat et. Ayrıca bu adres github'da oluşturduğun appdeki Homepage URL ve Callback URL ile eşleşmeli.
      örnek olarak:
      .env:
      NEXT_PUBLIC_BASE_URL = localhost:3000
      homepage: localhost:3000
      callback url: localhost:3000/api/auth/callback/github

    • @mehmethanifierenler3612
      @mehmethanifierenler3612 3 місяці тому +1

      @@ugurcodes Teşekkür ederim. https kullanmışım http yapınca düzeldi

    • @ugurcodes
      @ugurcodes  3 місяці тому

      @@mehmethanifierenler3612 rica ederim 😇

  • @prashlovessamosa
    @prashlovessamosa 3 місяці тому

    can you please make a series of Next Auth as you created for lucia

    • @ugurcodes
      @ugurcodes  3 місяці тому

      yes I can! what should be the next video then :)

  • @youssefbaaziz
    @youssefbaaziz 3 місяці тому +1

    Thanks a Lot

  • @alexdin1565
    @alexdin1565 3 місяці тому

    also if you want to use facebook its not work

  • @engesin
    @engesin 3 місяці тому

    Very good ✌️

  • @micbln8967
    @micbln8967 19 днів тому

    is nobody able to bring up a COMPLETE template? nice that email and db session here works. but without email verification and 2fa with loginform + email link come on guys it's not the year 2000 where simple email+pw was enough...