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
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
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?
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
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 ...
I need this so much. Thank you.
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
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
This is better than the docs
this is exactly the docs
thank you for this amazing tutorial
Some people are born teachers ♥
Great video, still running into some issues would be great if I could peak into the source code
Very good video..Thank you very much
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?
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
Very good, thank you
i am really confused about how do we handle the errors in the authorized callback just return null?
how do I get the current session?
Are you planning to provide the source code?
Eww.. super cool and well explained Thanks a lot ❤
Error [auth][error] CredentialsSignin, how fix?
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 ...
'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;
@@darrensings25 thank you i managed to do this by setting up nextauth api route and session provider
Osm ❤
came for the thumbnail stay for the intro
thanks
github code?
Its great but It feels like you're reading from a script :D