NextAuth Credentials Provider Integration | Next.js App router

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 25

  • @paakofibamfoquaicoe4193
    @paakofibamfoquaicoe4193 ปีที่แล้ว +4

    I need this so much. Thank you.

  • @TozzaYT
    @TozzaYT 11 หลายเดือนก่อน +9

    Errors I've experienced:
    - react-dom has no exported member useFormState for 6:01 ,
    FIX: run npm i @types/react-dom@latest
    - middleware never runs
    FIX: put middleware.ts within the src/ directory
    - styling is messed up when not authenticated,
    FIX: Next.js is making some request to /_next/* and you like don't include /_next/ in your whitelist which redirects the request to the login page, those requests are needed and but are never finished. Merge the regex from 3:59 with your existing regex

    • @mimran3997
      @mimran3997 11 หลายเดือนก่อน

      I'm facing an issue everything is working fine but after login with correct and wrong credentials getting always nothing, callback on auth.config.ts is returning auth as null means at const isLoggedIn= !!auth?.user returning false

  • @pedroapfilho
    @pedroapfilho ปีที่แล้ว +10

    This is better than the docs

    • @timtimatatara
      @timtimatatara 8 หลายเดือนก่อน

      this is exactly the docs

  • @moroccan_pentester
    @moroccan_pentester 6 หลายเดือนก่อน

    thank you for this amazing tutorial

  • @MiladJoodi
    @MiladJoodi 10 หลายเดือนก่อน

    Some people are born teachers ♥

  • @pabloendara-santiago514
    @pabloendara-santiago514 ปีที่แล้ว +5

    Great video, still running into some issues would be great if I could peak into the source code

  • @StephanSenkyireDuah
    @StephanSenkyireDuah 6 หลายเดือนก่อน

    Very good video..Thank you very much

  • @destocot1729
    @destocot1729 ปีที่แล้ว +1

    whats the reason for having two auth configs if we spread one into the other anyways?
    my assumption is that we only want the authorize callback to run in the middleware?
    if we imported it all from one config file it would run all the callbacks on every route?
    also: do we no longer need api/auth/[...nextauth]
    I noticed you did not export the handlers function
    does anything change if we use multiple providers?

  • @mimran3997
    @mimran3997 11 หลายเดือนก่อน

    I'm facing an issue everything is working fine but after login with correct and wrong credentials getting always nothing, callback on auth.config.ts is returning auth as null means at const isLoggedIn= !!auth?.user returning false

  • @agenciavolksein5486
    @agenciavolksein5486 11 หลายเดือนก่อน

    Very good, thank you

  • @kakun7238
    @kakun7238 11 หลายเดือนก่อน

    i am really confused about how do we handle the errors in the authorized callback just return null?

  • @TozzaYT
    @TozzaYT 11 หลายเดือนก่อน +1

    how do I get the current session?

  • @itsyourboyt4683
    @itsyourboyt4683 ปีที่แล้ว +2

    Are you planning to provide the source code?

  • @AhmedSoso-s4x
    @AhmedSoso-s4x ปีที่แล้ว

    Eww.. super cool and well explained Thanks a lot ❤

  • @viniciosragazzi
    @viniciosragazzi 11 หลายเดือนก่อน

    Error [auth][error] CredentialsSignin, how fix?

  • @codyt_arsis6698
    @codyt_arsis6698 ปีที่แล้ว

    how do i use useSession hook in client components? or is there an
    alternative way to get session user from client side? i need to display user infos like name profile pic ...

    • @darrensings25
      @darrensings25 11 หลายเดือนก่อน +1

      'use client';
      import { useSession } from "next-auth/react";
      const Profile = () => {
      const session = useSession();
      if (session.data?.user) {
      return From client: Signed In;
      }
      return From client: Signed Out;
      };
      export default Profile;

    • @codyt_arsis6698
      @codyt_arsis6698 11 หลายเดือนก่อน

      ​@@darrensings25 thank you i managed to do this by setting up nextauth api route and session provider

  • @namandoshi3731
    @namandoshi3731 10 หลายเดือนก่อน

    Osm ❤

  • @addDexter
    @addDexter 11 หลายเดือนก่อน

    came for the thumbnail stay for the intro

  • @mehmethanifierenler3612
    @mehmethanifierenler3612 10 หลายเดือนก่อน

    thanks

  • @Nekromazer
    @Nekromazer 9 หลายเดือนก่อน

    github code?

  • @aurelianspodarec2629
    @aurelianspodarec2629 8 หลายเดือนก่อน

    Its great but It feels like you're reading from a script :D