Next Auth v5 Complete Guide in Next.js 15 with Prisma and MongoDB

Поділитися
Вставка
  • Опубліковано 8 січ 2025

КОМЕНТАРІ •

  • @Parvez-vb4sb
    @Parvez-vb4sb 5 місяців тому +10

    00:05 Demo
    02:15 Create Next.js project
    05:00 Install required packages
    06:45 Configure Auth.js v5 in Next.js
    12:45 Configure Prisma
    19:15 Configure mongodb url
    22:40 Generate prisma schema for mongodb
    24:00 Configure GitHub login
    26:35 App layout and manage sessions
    35:30 Login page UI
    39:00 login logout server actions
    46:13 Testing login with GitHub
    49:50 Protecting routes
    57:10 Protecting apis
    59:55 Build login page form
    01:06:50 login with credentials server action
    01:11:45 Credentials provider in auth.js v5
    01:13:55 hash password
    01:15:30 User registration
    01:17:20 Update User schema
    01:18:55 Final testing

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

    dude the AI copilot is amazing in itself. But also thank you for teaching how to use next-auth w/ prisma

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

    Thanks Umair. I was dealing with `signIn` issue for while. I was debugging since yesterday and not getting output. I was keep getting `NEXT_DIRECT` error but after using that switch case in auth.ts, it's working like charm.
    Keep posting 🚀

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

    All video of this playlist is worth to watch...pure quality content

  • @prashantmishra2179
    @prashantmishra2179 Місяць тому +2

    the server side action will give an error in NextJs 15 as they have more strict rules for separation of server side and client side code, and so for nextjs15, the sign in and signout functions should be directly called in the login and logout components.

  • @regilearn2138
    @regilearn2138 6 місяців тому +2

    Appreciate you for this, What is the best practice for frontend if we use micro service for backend, Micro frontend or any other would appreciate if you can teach us microfrontend with react MERN.

  • @codingwithgreat707
    @codingwithgreat707 6 місяців тому +1

    How can error be seen and handled in the login page?

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

    How nobody has this issue?
    PrismaClient is not configured to run in Edge Runtime. So when I get session - session = await auth(); I get that Prisma Client cannot run on Edge. any help?

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

      I used Vercel's Postgres that uses Neon basically. I had to follow the docs and initiate Prisma Client using @prisma/adapter-neon..

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

    try to deploy to vercel , but as long as i have the middleware.ts file in root folder i got error: Cross-reference between Middleware and Edge Function. if i delete the middleware.ts, is ok.

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

    I have a question ! if we change the prisma schema or anything else after we are done ! is there a need to rerun the
    npx prisma generate & npx prisma db push ?

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

    Please make a video on access token and refresh token with auth js

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

    Hello, I found a mistake in your README... change 'npx prisms db push' to 'npx prisma db push'... there is an 's' instead of an 'a'.

  • @33prathameshpatil67
    @33prathameshpatil67 6 місяців тому +2

    Getting error on
    handler : { GET , POST }
    How can i solve it

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

      I am getting the same error. The route.ts file in [...nextauth] is not letting me build

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

      its not handler instead its handlers object

  • @FaridAhmadNoori-qn3cv
    @FaridAhmadNoori-qn3cv 4 місяці тому +2

    till 1 hour the video was good after that you copy paste all the credential's and you say that you modified it idk what happened!

  • @Milad85-o9k
    @Milad85-o9k 6 місяців тому

    Fantastic video, please make a video for refresh token and access token with auth , thanks a million

  • @muhammadilham4986
    @muhammadilham4986 5 місяців тому

    Helpfully, thank you sir

  • @alexdin1565
    @alexdin1565 5 місяців тому

    please can you make login with facebook I searched on youtube but no one cover how we can login with facebook

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

    Good video .. how about a sign up form ?

    • @ProgrammingwithUmair321
      @ProgrammingwithUmair321  4 місяці тому +1

      User automatically get created in db while using signin form if it is not already created. So in single step form, we are handling signup and signin.
      This flow is being followed by many now a days.

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

    Why I get redirected to /api/auth/signin?callbackUrl=%2F whenever I want to sign in

    • @flashbyte
      @flashbyte 4 місяці тому +1

      I'm also curious to know that.

    • @Yui1is-e3x
      @Yui1is-e3x Місяць тому +1

      me too, i dont know what to do now.

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

    Thanks ! appreaciate if can have next video about reset password .

  • @yo1414
    @yo1414 6 місяців тому +1

    Awesome - yes, would love password reset via an email address :-)

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

    No sign up in this one ??

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

      My implementation of login auto register (signup) user in db if it is not already registered.

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

    Why use typescript if your code is full of any type?

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

    u save my day thank u

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

    turborepo + prisma +next + mongodb ?????????????

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

    Thanks! I think that dependencies mongodb and adapter/mongo are unnecessary because you are using prisma as orm

  • @MUSASAEED-qu4yl
    @MUSASAEED-qu4yl 6 місяців тому +1

    GOOD WORK

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

    where is the source code??

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

    Thanks brother