Fullstack Authentication & Authorization in Next.js using NextAuth V5 (Auth.js), Zod, Shadcn UI

  Рет қаралды 22,785

Aditya Singh

Aditya Singh

Күн бұрын

Пікірлер: 111
@AdityaSinghCodes
@AdityaSinghCodes 3 ай бұрын
Video for user registrations and how to make your auth edge compatible: kzbin.info/www/bejne/bZmUdaNvoseZbbM
@NarendraKumar-tc3bm
@NarendraKumar-tc3bm 7 күн бұрын
thank you so much for the video...i am sure no one has explained the AuthJs this good under an hour..
@AdityaSinghCodes
@AdityaSinghCodes 7 күн бұрын
Thank you for the kind words.
@uditmehra80
@uditmehra80 3 ай бұрын
The most satisfying video I found for the next auth 🎉
@rashitiwari3547
@rashitiwari3547 3 ай бұрын
The way you explained is very simple and easy to understand. Keep making such informative videos👍
@shubhamsoni108
@shubhamsoni108 3 ай бұрын
You have explained it very well, I liked it and understood it completely.
@UnchartedWorlds
@UnchartedWorlds 26 күн бұрын
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 :)
@eduardlucaci7369
@eduardlucaci7369 14 күн бұрын
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.
@anishpal6243
@anishpal6243 Ай бұрын
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
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
Thank you so much for this amazing comment man. Def more content to come. Thanks for the support.
@anishpal6243
@anishpal6243 Ай бұрын
@@AdityaSinghCodes Looking forward brother
@markdioneeb8997
@markdioneeb8997 Ай бұрын
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.
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
Thank you. Def I will create more videos in the future regarding this.
@RupakGoura
@RupakGoura 3 ай бұрын
This is the best explaination that i found till now regarding the auth v5
@iainattwater1747
@iainattwater1747 2 ай бұрын
Really great video - thank you. Definitely do the registration flow too.
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Will do!
@ambujtiwari4373
@ambujtiwari4373 9 күн бұрын
Perfect explanation
@reni_christian
@reni_christian 2 ай бұрын
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.
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Hey thank you so much. I already uploaded the user registration video. Please check the pinned comment.
@PritamChakroborty-fe4hv
@PritamChakroborty-fe4hv 2 ай бұрын
Videos are extremely helpful. Efforts are appreciated.
@fullHulk
@fullHulk Ай бұрын
This is a really informative video. Thank you!
@SirajAhmed-kz3gq
@SirajAhmed-kz3gq 2 ай бұрын
Brother don't give up! 🙌 You will be on the day at the top 🌟 because your content is high quality plus simple to understand! 📈
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
I appreciate that!
@SirajAhmed-kz3gq
@SirajAhmed-kz3gq 2 ай бұрын
​@@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!"​
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
That's great. I wish you the best on your journey.
@SirajAhmed-kz3gq
@SirajAhmed-kz3gq 2 ай бұрын
@@AdityaSinghCodes Thanks
@josevelez6865
@josevelez6865 Ай бұрын
Excellent video! Thank you so much!
@MesaTube
@MesaTube 6 күн бұрын
you saved me bro , , thanks
@vernonmosterd6338
@vernonmosterd6338 2 ай бұрын
Great session. Thank You
@ajinkyabendre777
@ajinkyabendre777 Ай бұрын
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
@AdityaSinghCodes
@AdityaSinghCodes 29 күн бұрын
Yupp
@UnchartedWorlds
@UnchartedWorlds 26 күн бұрын
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
@James-uv7zt
@James-uv7zt 2 ай бұрын
great video and communication dude
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Appreciate it!
@dulansandaruwan3045
@dulansandaruwan3045 2 ай бұрын
Great video and well explained. hope you can create user registration video as well
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Yes, soon
@memester6496
@memester6496 3 ай бұрын
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?
@AdityaSinghCodes
@AdityaSinghCodes 3 ай бұрын
Yes. You can definitely use middleware for that.
@AhmadHassan-o6f
@AhmadHassan-o6f Ай бұрын
Good work ha ap ka
@jonelhatwell3959
@jonelhatwell3959 2 ай бұрын
Great Tutorial ❤
@timeg7791
@timeg7791 Ай бұрын
great video subscribed
@Kamlesh20005
@Kamlesh20005 3 ай бұрын
Subscribed ✅
@dheerajvithalkar
@dheerajvithalkar 2 ай бұрын
BHai og, literally og
@UnchartedWorlds
@UnchartedWorlds 25 күн бұрын
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
@AdityaSinghCodes 25 күн бұрын
Hey, thanks for the feedback. I will improve upon this.
@UnchartedWorlds
@UnchartedWorlds 25 күн бұрын
@AdityaSinghCodes much appreciated 🥰
@TechKaj
@TechKaj Ай бұрын
Best tutorial for every developers. thank you dude, just pin me.
@MayankThakur-kj3nd
@MayankThakur-kj3nd 3 ай бұрын
Great Video!
@miszka_
@miszka_ Ай бұрын
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
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
Thank you. Is this happening in the repo I have provided or you have created your own ?
@miszka_
@miszka_ Ай бұрын
@@AdityaSinghCodes I was able to find issue, your code works perfectly. I miss-typed word middleware with only one d
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
Perfect
@purvesh62
@purvesh62 Ай бұрын
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.
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
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.
@AsharSi
@AsharSi Ай бұрын
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.
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
What is the issue?
@AsharSi
@AsharSi Ай бұрын
​@@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
@lamatilda
@lamatilda Ай бұрын
Thanks for the tuto 🙌 What is the name of the font you used for your video ?
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
You can get the font from here. vercel.com/font
@thepromisebenard
@thepromisebenard 3 ай бұрын
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?
@AdityaSinghCodes
@AdityaSinghCodes 3 ай бұрын
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
@thepromisebenard
@thepromisebenard 3 ай бұрын
@@AdityaSinghCodes Thank you so much, i appreciate your efforts
@haodev01
@haodev01 2 ай бұрын
I think you used get session in root layout(navbar), children pages is a dymaic pages ??
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Not sure what are you talking about
@haodev01
@haodev01 2 ай бұрын
@@AdityaSinghCodes You have used session in the root layout, this makes the child pages dynamic
@aman_singh__
@aman_singh__ 2 ай бұрын
authorization callbacks isn't working my app is not redirecting to '/' when already logged in. Any solution ?
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Check the repo I have provided.
@saksham_1612
@saksham_1612 Ай бұрын
Just decrease the width of line in editor other things are really nice 💯
@alexdin1565
@alexdin1565 3 ай бұрын
please can you add vidoe about accesToken and RefreshToken rotation
@AdityaSinghCodes
@AdityaSinghCodes 3 ай бұрын
will make a video about this
@priyalraj285
@priyalraj285 26 күн бұрын
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.
@AdityaSinghCodes
@AdityaSinghCodes 26 күн бұрын
What issue you are facing in production ?
@priyalraj285
@priyalraj285 26 күн бұрын
@@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.
@timeg7791
@timeg7791 Ай бұрын
the action folder is not there in our github repo
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
It is there.
@flashbyte
@flashbyte 2 ай бұрын
Please make a video on prisma too with mongodb as DB
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Coming soon
@doitwithdevon
@doitwithdevon 2 ай бұрын
@@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.
@abusomwansantos4945
@abusomwansantos4945 2 ай бұрын
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.
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
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.
@FarmingwithFahim-hb9jy
@FarmingwithFahim-hb9jy 11 күн бұрын
Bro the github repo you use Can i able to use this code cope and pase
@AdityaSinghCodes
@AdityaSinghCodes 10 күн бұрын
Go ahead bro.
@Fatma-hy5qx
@Fatma-hy5qx 4 күн бұрын
Thanks, Is a verification e-mail sent here?
@AdityaSinghCodes
@AdityaSinghCodes 3 күн бұрын
Not in this one. But in the upcoming video
@AsharSi
@AsharSi Ай бұрын
Credentials login will not work in authjs when you will use mongodbadapter
@AdityaSinghCodes
@AdityaSinghCodes Ай бұрын
Watch my user registration video.
@lakshitha_sandamal
@lakshitha_sandamal 2 ай бұрын
@ramaalfinbaehaqi7872
@ramaalfinbaehaqi7872 2 ай бұрын
Store and refresh token please
@AdityaSinghCodes
@AdityaSinghCodes 26 күн бұрын
I will create a video on this when next auth supports this. Right now a race condition might occur during this process.
@teachingEverythingAmLearning
@teachingEverythingAmLearning 2 ай бұрын
Do you mind sharing the github repo?
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
check description
@thejeffkershner
@thejeffkershner 29 күн бұрын
Why so much space between the lines of your code?!?
@AdityaSinghCodes
@AdityaSinghCodes 29 күн бұрын
I like it that way.
@wk1953
@wk1953 2 ай бұрын
Github repo does now work :(
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
Most likely you have not generated the auth secret. Updated readme also.
@from.houseofgandhi
@from.houseofgandhi 3 ай бұрын
Github repo link ??
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
check description
@abolfazldexter-u8c
@abolfazldexter-u8c 2 ай бұрын
source code?
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
check description
@shakirraza8121
@shakirraza8121 3 ай бұрын
github repo plz
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
check description
@qadeerkhan2228
@qadeerkhan2228 2 ай бұрын
i clone your repo but it don't let me loguot ?
@uditmehra80
@uditmehra80 2 ай бұрын
Working perfectly fine for me😅
@AdityaSinghCodes
@AdityaSinghCodes 2 ай бұрын
just checked. working absolutely fine.
@murali-krishnan
@murali-krishnan 9 күн бұрын
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
@AdityaSinghCodes 9 күн бұрын
Share your repo url. I will see if I can help.
@murali-krishnan
@murali-krishnan 9 күн бұрын
@@AdityaSinghCodes I can't share the repo link here. It got auto-deleted by KZbin. Are you on X? Or Can I share the code here?
@AdityaSinghCodes
@AdityaSinghCodes 9 күн бұрын
x.com/adityasinghcode
@ritikkushwaha3355
@ritikkushwaha3355 2 ай бұрын
great
Next.js 15 Breakdown (Everything You Need To Know)
18:10
Web Dev Simplified
Рет қаралды 74 М.
Things I Don’t Like about Vue.js (as a React engineer)
16:16
Harry Wolff
Рет қаралды 15 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
One day.. 🙌
00:33
Celine Dept
Рет қаралды 50 МЛН
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 139 МЛН
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 22 МЛН
Next.js Authentication With Next-Auth V5 Credential Provider
21:02
tapaScript by Tapas Adhikary
Рет қаралды 26 М.
Next.js Credentials Auth Made Easy with Better Auth
1:07:38
Cand Dev
Рет қаралды 3,5 М.
Authentication Flow in Next.js (Complete Tutorial)
30:37
Cosden Solutions
Рет қаралды 23 М.
Increased Next.js App Performance By 30%.
22:38
Aditya Singh
Рет қаралды 4 М.
E-Commerce clone will not get you hired - Real world project ideas
18:57
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН