Hey man! I just want to thank you with all my heart and I am truly grateful to you for this wonderful tutorial. You won't believe the amount of trouble I had been having since the last couple of days trying to figure out how Auth Js works and how to make it work properly with social login. Even when I could, I was unable to understand how to make it work for getting extra information in the session, specifically the id. In one single tutorial you have covered everything and not only did you deliver what was promised, your tutorial's quality was exceptional! I had a lot of fun following along your video and it cleared all my doubts! I have liked and subscribed as a show of support and thanking you for your contributions, please keep uploading more great content in the future! I would love to have a detailed in-depth video on Prisma and Auth JS
You have a very outstanding way of delivering your tutorials, I hope you tackle next time an actual sign-in where we are checking a real database if the user exists. Thank you very much man.
Very well explained.👍 Looking forward for User Registration video and session based auth as well. Love you content and the way of explanation. Keep it up.
Hi thanks for the tutorial, anyone having issues typing npx shadcn-ui@latest add card, you need to remove -ui part, its not required when installing with npx :)
Hi, thank you so much for the video. One thing is missing here, if you want, you can split the video on different sections to be easy to follow and switch between sections.
Man this is what I wanted. What a lovely explaination. Each and everything is clear and to the point as well. Thank you. 1 question. so instead of using the callback we can use middleware to restrict admin or user from specific pages?
6:30 if you have issues importing @auth, do not forget to setup alias inside tsconfig.json, something like: "@/auth": ["./src/auth.ts"] in case your project was by default setup to use src folder... adding that should fix the import
@@AdityaSinghCodesI followed the documentation and verified my code with your video tutorial, ensuring that my code was identical. However, I encountered issues with credential authentication due to the use of MongoDBAdapter. Upon removing it, the authentication started working seamlessly. I realized that the adapter was the root cause of the problem
Hey, thanks for the informative video. I have a question in Auth.js. If I'm using JWT tokens then how do I set an expiry for that tokens that they automatically redirects me to logout? It seems like Authjs never expires the session tokens.
Aditya, it would be super helpful when we follow along if your code doesn't use such high spacing between lines, it's hard to catch all the code when lots of it is out of the view and when you scroll super fast to next step. Just a suggestion :) I enjoy your tutorials so far, recent subscriber :)
@@AdityaSinghCodes Like session management, like how to save the token? Currently using next auth v5, it uses __Secure-authjs.session-token in cookies in prod, but when I try to save a cookie with same name, it don't work. Like how the session will be managed for cred? It's automated for Google & Linkedin. And I am using database instead of jwt for session strategy.
Love the video my man. First video that explains subject easly in understandable way! I have only one issue with this code, for some reason in auth.ts callback authorized dosent seams to work for me, I can freely access /page2 without being even logged in. Do you have any ideas why that could be happening? Adding random console logs for debugging perps shows no activity in authorized callbacks
goodjob bro, please ive an issue. when I deploy my app, the login screen doesn't redirect to the dashboard even though the URL changes, but when I change the AUTH_URL to localhost:3000 it works perfectly well, soon as I take it back to the vercel domain it doesn't work anymore.
I'm not getting any user session details in the Navbar like you get @14:17 even though I wrapped the rootlayout with SessionProvider. I get the object that has expires with some date. But the user has only {} empty object. Could you help me figure this out? I've been banging my head for the last 2 days. I'm using the latest next.js app "next": "15.0.3", "next-auth": "^5.0.0-beta.25", "react": "19.0.0-rc-66855b96-20241106", "react-dom": "19.0.0-rc-66855b96-20241106",
@@AdityaSinghCodes Highly anticipated, would also like to understand how to not block off the entire app and force users to sign in to access the site.
Video for user registrations and how to make your auth edge compatible: th-cam.com/video/7h1Dp9mbf7Q/w-d-xo.html
thank you so much for the video...i am sure no one has explained the AuthJs this good under an hour..
Thank you for the kind words.
The most satisfying video I found for the next auth 🎉
You have explained it very well, I liked it and understood it completely.
The way you explained is very simple and easy to understand. Keep making such informative videos👍
Hey man! I just want to thank you with all my heart and I am truly grateful to you for this wonderful tutorial. You won't believe the amount of trouble I had been having since the last couple of days trying to figure out how Auth Js works and how to make it work properly with social login. Even when I could, I was unable to understand how to make it work for getting extra information in the session, specifically the id.
In one single tutorial you have covered everything and not only did you deliver what was promised, your tutorial's quality was exceptional! I had a lot of fun following along your video and it cleared all my doubts!
I have liked and subscribed as a show of support and thanking you for your contributions, please keep uploading more great content in the future! I would love to have a detailed in-depth video on Prisma and Auth JS
Thank you so much for this amazing comment man. Def more content to come. Thanks for the support.
@@AdityaSinghCodes Looking forward brother
You have a very outstanding way of delivering your tutorials, I hope you tackle next time an actual sign-in where we are checking a real database if the user exists. Thank you very much man.
Thank you. Def I will create more videos in the future regarding this.
Thanks!
Thank you for the support man.
This is the best explaination that i found till now regarding the auth v5
Really great video - thank you. Definitely do the registration flow too.
Will do!
Very well explained.👍 Looking forward for User Registration video and session based auth as well. Love you content and the way of explanation. Keep it up.
Hey thank you so much. I already uploaded the user registration video. Please check the pinned comment.
Hi thanks for the tutorial, anyone having issues typing npx shadcn-ui@latest add card, you need to remove -ui part, its not required when installing with npx :)
Brother don't give up! 🙌 You will be on the day at the top 🌟 because your content is high quality plus simple to understand! 📈
I appreciate that!
@@AdityaSinghCodes "You're welcome! By the way, I'm a 15-year-old learning to code, and your tutorials have been super helpful on my journey!"
That's great. I wish you the best on your journey.
@@AdityaSinghCodes Thanks
@@AdityaSinghCodes I Got My First Job! as a mobile developer.
Videos are extremely helpful. Efforts are appreciated.
Perfect explanation
This is a really informative video. Thank you!
Hi, thank you so much for the video. One thing is missing here, if you want, you can split the video on different sections to be easy to follow and switch between sections.
Excellent video! Thank you so much!
Man this is what I wanted. What a lovely explaination. Each and everything is clear and to the point as well. Thank you. 1 question. so instead of using the callback we can use middleware to restrict admin or user from specific pages?
Yes. You can definitely use middleware for that.
great video and communication dude
Appreciate it!
BHai og, literally og
Great session. Thank You
6:30 if you have issues importing @auth, do not forget to setup alias inside tsconfig.json, something like: "@/auth": ["./src/auth.ts"] in case your project was by default setup to use src folder... adding that should fix the import
you saved me bro , , thanks
Great Tutorial ❤
Good work ha ap ka
great video subscribed
Great video and well explained. hope you can create user registration video as well
Yes, soon
Subscribed ✅
I really don't know how credential login is working in your app. Tried hours fixing the issue but it isn't working for me.
What is the issue?
@@AdityaSinghCodesI followed the documentation and verified my code with your video tutorial, ensuring that my code was identical. However, I encountered issues with credential authentication due to the use of MongoDBAdapter. Upon removing it, the authentication started working seamlessly. I realized that the adapter was the root cause of the problem
Hey, thanks for the informative video. I have a question in Auth.js. If I'm using JWT tokens then how do I set an expiry for that tokens that they automatically redirects me to logout? It seems like Authjs never expires the session tokens.
You should be able to do this by adjusting the maxAge property inside of the session property. I believe default token expiration time is 30 days.
Best tutorial for every developers. thank you dude, just pin me.
Aditya, it would be super helpful when we follow along if your code doesn't use such high spacing between lines, it's hard to catch all the code when lots of it is out of the view and when you scroll super fast to next step. Just a suggestion :) I enjoy your tutorials so far, recent subscriber :)
Hey, thanks for the feedback. I will improve upon this.
@AdityaSinghCodes much appreciated 🥰
It works great with Google & Linkedin for me, but with creds login, how to manage the session? Like it works in localhost, but no in prod.
What issue you are facing in production ?
@@AdityaSinghCodes Like session management, like how to save the token? Currently using next auth v5, it uses __Secure-authjs.session-token in cookies in prod, but when I try to save a cookie with same name, it don't work. Like how the session will be managed for cred? It's automated for Google & Linkedin. And I am using database instead of jwt for session strategy.
I think you used get session in root layout(navbar), children pages is a dymaic pages ??
Not sure what are you talking about
@@AdityaSinghCodes You have used session in the root layout, this makes the child pages dynamic
authorization callbacks isn't working my app is not redirecting to '/' when already logged in. Any solution ?
Check the repo I have provided.
Love the video my man. First video that explains subject easly in understandable way! I have only one issue with this code, for some reason in auth.ts callback authorized dosent seams to work for me, I can freely access /page2 without being even logged in. Do you have any ideas why that could be happening? Adding random console logs for debugging perps shows no activity in authorized callbacks
Thank you. Is this happening in the repo I have provided or you have created your own ?
@@AdityaSinghCodes I was able to find issue, your code works perfectly. I miss-typed word middleware with only one d
Perfect
Thanks for the tuto 🙌 What is the name of the font you used for your video ?
You can get the font from here. vercel.com/font
Bro the github repo you use Can i able to use this code cope and pase
Go ahead bro.
the action folder is not there in our github repo
It is there.
goodjob bro, please ive an issue. when I deploy my app, the login screen doesn't redirect to the dashboard even though the URL changes, but when I change the AUTH_URL to localhost:3000 it works perfectly well, soon as I take it back to the vercel domain it doesn't work anymore.
Hi. This could be related with auth untrusted host. You need to add 2 extra environment variables. I updated the repo .env.example file. Thank you.
Thanks, Is a verification e-mail sent here?
Not in this one. But in the upcoming video
Credentials login will not work in authjs when you will use mongodbadapter
Watch my user registration video.
I'm not getting any user session details in the Navbar like you get @14:17 even though I wrapped the rootlayout with SessionProvider. I get the object that has expires with some date. But the user has only {} empty object. Could you help me figure this out? I've been banging my head for the last 2 days.
I'm using the latest next.js app
"next": "15.0.3",
"next-auth": "^5.0.0-beta.25",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
Share your repo url. I will see if I can help.
@@AdityaSinghCodes I can't share the repo link here. It got auto-deleted by TH-cam. Are you on X? Or Can I share the code here?
x.com/adityasinghcode
Nice video Aditya. I really love your vscode. please what theme and font do you use? Is it possible we can get your vscode settings or so?
Thank you. Since a lot of people ask me about my setup, I created a page on gumroad. You can get the full config here: adityasinghcodes.gumroad.com
@@AdityaSinghCodes Thank you so much, i appreciate your efforts
please can you add vidoe about accesToken and RefreshToken rotation
will make a video about this
Great Video!
Do you mind sharing the github repo?
check description
Store and refresh token please
I will create a video on this when next auth supports this. Right now a race condition might occur during this process.
Github repo does now work :(
Most likely you have not generated the auth secret. Updated readme also.
Github repo link ??
check description
❤
Please make a video on prisma too with mongodb as DB
Coming soon
@@AdityaSinghCodes Highly anticipated, would also like to understand how to not block off the entire app and force users to sign in to access the site.
Why so much space between the lines of your code?!?
I like it that way.
Just decrease the width of line in editor other things are really nice 💯
good one. you can also make small video on how we can fetch user from database using prisma instead of hardcoding may be in seperate video
Yupp
i clone your repo but it don't let me loguot ?
Working perfectly fine for me😅
just checked. working absolutely fine.
source code?
check description
github repo plz
check description
great