This is exactly what I needed! I was struggling with setting up NextAuth for MongoDB. Granted, I was using Prisma, and that was my first experience with it. Either way, thank you for this video!
I love your video Sir. I’m currently building a shopping website for my business and your Nextauth tutorial is what I needed… you’ve got a subscriber ❤️❤️❤️ Looking forward to your videos on More Nextjs Videos
thanks, i had a problem with nextauth, it said me access denied but the problem was in the function signin in [...nextauth] it not return a true value jjajaja
It was a really helpfull video. I wanted to ask if I have login with credentials also than should I make the password optional in my postgres database.
Hi, is there a way we can show a toast success message on successful sign in from google (or any other provider)? I have implemented it Credential Providers as the signIn() returns a promise in that case and we are allowed to do something like this, res = await signIn(), if res.error == null, toast.success(msg) but I am unable to do similar thing with providers like google any help would be appreciated
Awesome! Can you make a part 2 of this? that when you successfully logged in it will redirect/connect to the home page with your name and avatar from your gmail. Thanks!
great article. Am I missing something? Provider component has session as prop. So how are using Provider with undefined session and you are getting good results?
I am having a user model which includes password also, scenerio is I am using both Google provider and credential provider, in my credentials I have two extra field.. Role:"user" and createdAt: "" what I did is in callbacks signin I want to add these two fields but now it is showing error that validation failed, pls enter your password, as Google does not send password in usessesion . Lmk how to handle this situation
If you want to pass properties like an accessToken then you will need to use the asynchronous callbacks that Next Auth provides you. I have a video of how to pass properties into these callbacks on my channel!
Please clarify this: you are using 'use client' how come your console log is logging out values on the server while indicating component as client side? I'm a bit confused here.
On 9:20 the terminal is bloated with some weird warnings even tho everything should work ok. Do you know what are those and how to get rid of them? btw thanks for your work
someone get this guy an award
Best video I've seen about next-auth, really appreciate you explaining every detail of the callbacks
Thank you!
This is exactly what I needed! I was struggling with setting up NextAuth for MongoDB. Granted, I was using Prisma, and that was my first experience with it. Either way, thank you for this video!
Glad it helped!
This clarifies alot ❤
I love your video Sir. I’m currently building a shopping website for my business and your Nextauth tutorial is what I needed… you’ve got a subscriber ❤️❤️❤️
Looking forward to your videos on More Nextjs Videos
Glad it was helpful! Thanks for the sub!
You are a natural.
Thank you I try to be!
Another awesome video. Keep posting please!
Thank you!
thankx bro it help me alot and I learned a lot from you
No problem! Glad you liked it! I will be going live tonight as well if you need any help or just want to stop by!
that's clear teaching thanks
No problem! Thanks for tuning in!
Thank You very mutch!!!
You're welcome! Thanks for the sub!
Awesome Bro👍 keep it up 👍👍 #From_Kashmir India
Thanks
Thankyou bro❤
You are welcome!
Hi Brett, your videos are great. I would suggest including typescript into your tutorials
Thanks for watching and my newer videos will be inculding TypeScript
Very good video thank you! Could you please provide some information on how to save refreshtoken? And how to rotate it if necessary?
thanks, i had a problem with nextauth, it said me access denied but the problem was in the function signin in [...nextauth] it not return a true value jjajaja
It's weird that you posted this today. Yesterday I was thinking I need to ask you to make a video on authentication.
Just reading minds out here!
How would you do if you need to add a GitHub or Facebook login and with their own respective callback logics, but one global callback function?
It was a really helpfull video. I wanted to ask if I have login with credentials also than should I make the password optional in my postgres database.
I have two separate models one for user and one for account.
Hi, is there a way we can show a toast success message on successful sign in from google (or any other provider)?
I have implemented it Credential Providers as the signIn() returns a promise in that case and we are allowed to do something like this, res = await signIn(), if res.error == null, toast.success(msg) but I am unable to do similar thing with providers like google
any help would be appreciated
Awesome! Can you make a part 2 of this? that when you successfully logged in it will redirect/connect to the home page with your name and avatar from your gmail. Thanks!
Yes I will do a video on that
great article. Am I missing something? Provider component has session as prop. So how are using Provider with undefined session and you are getting good results?
the root layout file should have a session={session}. I guess mine somehow still worked in the video
I am having a user model which includes password also, scenerio is I am using both Google provider and credential provider, in my credentials I have two extra field.. Role:"user" and createdAt: "" what I did is in callbacks signin I want to add these two fields but now it is showing error that validation failed, pls enter your password, as Google does not send password in usessesion
. Lmk how to handle this situation
After Sign in if we need to pass accessToken to external backend server build from node js to access protected routes then how will it works ?
If you want to pass properties like an accessToken then you will need to use the asynchronous callbacks that Next Auth provides you. I have a video of how to pass properties into these callbacks on my channel!
Please clarify this: you are using 'use client' how come your console log is logging out values on the server while indicating component as client side? I'm a bit confused here.
Yes if client side page then it would be in client console only and server side in the VSCode server
On 9:20 the terminal is bloated with some weird warnings even tho everything should work ok. Do you know what are those and how to get rid of them? btw thanks for your work
yes i typed in npm run deb instead of npm run dev
@@brettwestwooddeveloper just before that you can see "import trace for requested module" warning. I meant this
why aren't you using the mongodb adapter from the next-auth?
I just didn't for this video, but I would recommend using the MongoDB adapter honestly.
sir it should be on git so that everyone can use this code
bro how can use Mysql instead of mongodb to store the user and session, please 😭
Why?
next with postgresql
But where is the role ? Admir or user ?
Not in this video
@@brettwestwooddeveloper well which video ?
@@codewithsuslu don't have a video about roles at the moment
I dont want mongodb. I want postgres sir.. with love