Next.js Authentication || Register User To MongoDB With Next-Auth V5

  Рет қаралды 7,926

tapaScript by Tapas Adhikary

tapaScript by Tapas Adhikary

Күн бұрын

Пікірлер: 93
@TAPOSHGHOSH-iu2yx
@TAPOSHGHOSH-iu2yx 3 ай бұрын
we want to see Role Based User Authorization & Access Control in next js video also . keep doing that type of video.
@Leesdjo
@Leesdjo 3 ай бұрын
These three parts series about next-auth is seriously helpful. Thank you so much for your time creating it.
@tapasadhikary
@tapasadhikary 3 ай бұрын
Thank you for taking the time and acknowledging it. Appreciate it ❤️
@julianjupiter5890
@julianjupiter5890 2 ай бұрын
Indeed. Because of these I can now finally proceed learning Next.js.
@tapasadhikary
@tapasadhikary 2 ай бұрын
@julianjupiter5890 super
@pranavtripathi4181
@pranavtripathi4181 18 күн бұрын
There are not many detailed and updated videos as this. thank you so much for making this playlist.
@tawsifhaque9360
@tawsifhaque9360 3 ай бұрын
Excellent video as always and once again. Really rrally grateful to you and your content. Extremely appreciate the efforts you put in to make the concepts as easy as they can be. For a while now i was scouring the internet for easy to understand credentials login using next auth in an easy way. Only your video i came across that made me understand the concept extremely well. Such quality content deaerves more recognition. Thank you once again for making the concepts stupidly simple to understand. Im definitely going to save this video as one of my favorites in KZbin and will refer back to it from time to time. Thank you much sir
@tapasadhikary
@tapasadhikary 3 ай бұрын
You are most welcome ❤️ Once you all share my content with others who may need it, will be a great help, too. Thanks a lot.
@fosbergaddai4996
@fosbergaddai4996 2 ай бұрын
You are so good, I can't wait to see how google auths persist to the database in next.js. I need it right now but I can wait
@tapasadhikary
@tapasadhikary Ай бұрын
Thanks man!
@yash-c7l5b
@yash-c7l5b Ай бұрын
thank you for releasing this series
@tapasadhikary
@tapasadhikary Ай бұрын
My pleasure
@__Gojo___
@__Gojo___ 3 ай бұрын
Waiting for Next part with access and refresh token handle ❤️
@tapasadhikary
@tapasadhikary 3 ай бұрын
Everyone is asking for this one 😀 I've planned it for June.
@MikhailShumakov
@MikhailShumakov 13 сағат бұрын
@@tapasadhikary Can confirm that session-handling is something I'm trying (and failing) to figure out right now so I'm very much looking forward to your next tutorial on handling tokens!
@ashlyvlogs772
@ashlyvlogs772 3 ай бұрын
Awesome video and explanation. I am curiously waiting for your next video.
@andrewpulyaev2539
@andrewpulyaev2539 Ай бұрын
That's the solution I was looking for in my app. Thx man!
@tapasadhikary
@tapasadhikary Ай бұрын
@@andrewpulyaev2539 great ❤️
@ashlyvlogs772
@ashlyvlogs772 3 ай бұрын
Can you please make a video on keeping the session and using the session authentication in client pages after logging in?
@BrunoAfonsoFernandes
@BrunoAfonsoFernandes Ай бұрын
Excellent video, Sir. You are an awesome teacher. You make this look so so easy. I am very glad I found your channel :)
@tapasadhikary
@tapasadhikary Ай бұрын
Welcome aboard! Let's go...
@steffenjusmann6276
@steffenjusmann6276 3 ай бұрын
please continue this series!! It is very helpful :)
@tapasadhikary
@tapasadhikary 3 ай бұрын
Absolutely! Next one is coming today 😄
@steffenjusmann6276
@steffenjusmann6276 3 ай бұрын
@@tapasadhikary Looking forward to that :)
@tapasadhikary
@tapasadhikary 3 ай бұрын
@@steffenjusmann6276 sorry I meant coming tomorrow, Thursday IST evening
@steffenjusmann6276
@steffenjusmann6276 2 ай бұрын
@@tapasadhikary I have a question regarding the auth session. How can I get the user _id from the MongoDB into my session? Currently, the session.user just has name and email. However, I would need the id as well. How can I add this to the session?
@LearnAlongFaizan
@LearnAlongFaizan Ай бұрын
please make a video on role based authentication in next js
@tapasadhikary
@tapasadhikary Ай бұрын
Yes brother.
@ratherlabs6692
@ratherlabs6692 15 күн бұрын
hey! nice video! which is the link to the next video: register users using oauth?
@dariusoflegend8989
@dariusoflegend8989 Ай бұрын
Thanks ❤‍🔥
@tapasadhikary
@tapasadhikary Ай бұрын
Welcome
@traezeeofor
@traezeeofor Ай бұрын
Please Sir the final piece of this series should be authentication with Magic Links Email Provider, the backend being MongoDB. I have followed all 4 parts of the series, and this would be a great encore. I searched the whole internet such a tutorial doesn't exists. Please do it for us. Many thanks!
@tapasadhikary
@tapasadhikary Ай бұрын
Ok I have never explored that but for you I will do 👍. Hope others will like it too… btw there is one big video coming next week on auth token and refresh token… so we are not done yet 😀
@traezeeofor
@traezeeofor Ай бұрын
@@tapasadhikary God bless you Sir. I have subscribed to your channel and I hope I will get the notification for the video this week. You're the best!
@tapasadhikary
@tapasadhikary Ай бұрын
@traezeeofor thanks! It will come next week as this week I have already planned other videos.
@traezeeofor
@traezeeofor Ай бұрын
@@tapasadhikary Alright Sir, I am patiently waiting. Thank you
@traezeeofor
@traezeeofor Ай бұрын
Because the Edge runtime only uses standard Web APIs, many packages are not compatible with it, such as the mongodb driver package. Please take note of above Sir. I encountered it in teh app I just build, Couldn't deploy as the build kept failing as a result. Eg: Creating an optimized production build ... Failed to compile. Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
@undefined55555
@undefined55555 Ай бұрын
great video. can you please make a dedicated course in building a complex real world production level app using next js and other necessary stack.
@tapasadhikary
@tapasadhikary Ай бұрын
It is very much in plan ❤️
@syedbilalchand1766
@syedbilalchand1766 3 ай бұрын
can you please make a video on the refresh token and access token in authv5
@tapasadhikary
@tapasadhikary 3 ай бұрын
Of course I can 😀 It's planned for June.
@nichas143
@nichas143 3 ай бұрын
Dada dil jeet liya aapne.. you have done it the best, have been through so many videos, udemy and so on.. You can be a Udemy star too. Thank you so much and keep it coming. My request is to suggest how zod can be useful along with typescript.
@tapasadhikary
@tapasadhikary 3 ай бұрын
Vai hardly people value free content, even there are so much effort and authenticity in it… I'm glad, my content and teaching started seeing the lights 😀🔥
@nichas143
@nichas143 3 ай бұрын
@@tapasadhikary Its not free its invaluable. I have gone through so much of content, I loved the way you teach so simply. Thankyou sir. Will keep waiting for more content from you.
@abdullahhasan4188
@abdullahhasan4188 3 ай бұрын
awesome Dada , how do i use next auth v5 session in middleware ?? please make a video on it. Thank you so much for your great content.
@tapasadhikary
@tapasadhikary 3 ай бұрын
You are welcome vai… it will come in a future video, planned already. One request would be please share about this next.js series with people so that there is awareness. Thanks ❤️🔥
@jellyfish1772
@jellyfish1772 Ай бұрын
Waiting for Next part with access and refresh token handle
@tapasadhikary
@tapasadhikary Ай бұрын
Hey, this is out, you know.
@mehmethanifierenler3612
@mehmethanifierenler3612 3 ай бұрын
very very thanks, i waiting posgrsql + drizzle
@imkir4n
@imkir4n 3 ай бұрын
Hello brother, please implement the refresh token logic as well. I'm struggling to do it in NextAuth.
@tapasadhikary
@tapasadhikary 3 ай бұрын
Bro, keep eye on this series. Its coming. I'll be implementing it on top of same code incrementally. Cheers!
@imkir4n
@imkir4n 3 ай бұрын
@@tapasadhikary Sure, Cheers!
@mdsumonh.shohan9159
@mdsumonh.shohan9159 4 күн бұрын
tapash vai mongodb and prisma diye ekta high fi level er project cai Prisma data modeling scema i hope you wil give. Thanks vai for this video
@andriisemenov5863
@andriisemenov5863 2 ай бұрын
Great work! Finally my auth is working, thank you =) There is 1 problem that I encountered. The login only works when the db connection is already established through the singup route. What's the best way to establish db connection for the login route to work right away?
@tapasadhikary
@tapasadhikary 2 ай бұрын
Glad I could help. I find the root layout is a great place to do this connection initialization.
@nasarullahkhan3379
@nasarullahkhan3379 3 күн бұрын
Please use server action.
@tapasadhikary
@tapasadhikary 3 күн бұрын
We certainly could, but the intention here was to showcase the API creation and performing mutation with that too... To add to the same point, server action may not be the preferred solution always for regular CURD... consider the cost of execution post deplymnment as well.
Ай бұрын
Question: why for registration it was necessary to turn the form into a client component and consequently do a server call to the api instead of following the same pattern that you used for the social signin? (please consider that I'm quite new to Next/React)
@tapasadhikary
@tapasadhikary Ай бұрын
That's a great question and I am glad you are already thinking in Next.js way! yes, I could have done the same.. keeping it as a server component itself, enclosing the JSX inside a form with action attribute, then and calling a server action to do the job. I didn't do it only to show another alternate way of achieving the same thing. See, in an app, all the components may not be server components, we will have client components, a form in it and REST API endpoints to hit. So I wanted to cover that part while showing the registration approach. You can take either of the approaches based on the design you have opted for your app... and the availability of the communication mechanism, a REST endpoint(like in this case), or through a server function direct service call. I hope I answered your question here. Thanks for watching and asking 😄
@tejasgiri1650
@tejasgiri1650 Ай бұрын
Hello sir, video was great, can you create a magin link authentication using next auth and also project external node.js server routes?
@tapasadhikary
@tapasadhikary Ай бұрын
@@tejasgiri1650 magic link next week
@tusharphb6596
@tusharphb6596 3 ай бұрын
Thanks Dada for this detailed video of authjs v5 ❤ I have fewer questions like authjs v5 is ready to use for production? As it is still in beta. There are other alternatives like Auth0 and Lucia Auth, should we go for them for production or use authJs beta in production?
@tapasadhikary
@tapasadhikary 3 ай бұрын
Welcome. Yes, Next-Auth V5 is not stable yet. That's one reason I am making these content with my discoveries with it. It still has issues, but we hope to be stable soon. An alternative open-source(if possible free) & stable solution is surely worth looking into in the mean time.
@FoxMake
@FoxMake 18 күн бұрын
how to secure api end point in auth.js when we use auth() function inside a api route it always return null why is that
@ericsiddiq7634
@ericsiddiq7634 3 ай бұрын
❤❤❤❤❤
@tapasadhikary
@tapasadhikary 3 ай бұрын
❤❤❤
@alexdin1565
@alexdin1565 2 ай бұрын
please can you make a video about login using facebook?
@tapasadhikary
@tapasadhikary 2 ай бұрын
Won't it be mostly similar to the two I showed here? Are you facing any issues with FB?
@sohaibabdullah9073
@sohaibabdullah9073 3 ай бұрын
Great sir g
@tapasadhikary
@tapasadhikary 3 ай бұрын
Thanks, Sir G 🤟
@monir63
@monir63 3 ай бұрын
How to protect api endpoint with middlwer and make private routes with middlwer make videos
@tapasadhikary
@tapasadhikary 3 ай бұрын
That's the next video coming this week 😊
@monir63
@monir63 3 ай бұрын
@@tapasadhikary thanks
@ZulfikarPremium
@ZulfikarPremium 3 ай бұрын
include session or just add data to table user ?
@Anurag_Badwahe
@Anurag_Badwahe 3 ай бұрын
Sir auth provider local me work kar rahe par production me nahi.. How can i solve this issur
@tapasadhikary
@tapasadhikary 3 ай бұрын
Issue kiya hai vai?
@Anurag_Badwahe
@Anurag_Badwahe 3 ай бұрын
@@tapasadhikary domain_name/api/auth/error?error=Illegal%20arguments%3A%20undefined%2C%20number
@Anurag_Badwahe
@Anurag_Badwahe 3 ай бұрын
screen pe ek div aata hai uspe Error phir niche domain name likha aata hai
@Pushkarcdn
@Pushkarcdn 2 ай бұрын
#504_error Sir, I have done everything same as done in the video... Then, 1. Changed the MONGO connection string to my mongo db atlas 2. Published the app on vercel 3. Set environment variables on vercel (including connection string) 4. Allowed all ip to connect to my mongodb atlas The signup process is working fine but the Login is not working. It says 504 gateway timeout. The same project when run on local it is working, only on vercel, it's showing 504 (only while logging in) Solutions tried: 1. Integrated vercel to mongodb atlas (as per stackoverflow community answers). 2. Allowed all ips to access my mongo db atlas What should i do to fix it ?
@tapasadhikary
@tapasadhikary 2 ай бұрын
Hey, thanks for trying out the deployment on Vercel and Atlas.... I have not tried it but my deployment is on Cloudflare and Atlas for a company project... It is working. The steps you mentioned is almost same. Make sure the IPs are correct. I would recommend you discuss this on our Discord as it is easier to see the log and screenshot to help out.. also other folks on discord may pitch in or learn from it. All the best.
@JosueRodriguez-dl8es
@JosueRodriguez-dl8es 2 күн бұрын
I followed your video, and I get an error saying 'Cannot read GET of undefined'.
@tapasadhikary
@tapasadhikary 2 күн бұрын
Try closely.. It will work. Use the code given for reference. 👍
@SonuSingh-sm7jy
@SonuSingh-sm7jy 2 ай бұрын
post method not working of your github repo when i register why is that?
@tapasadhikary
@tapasadhikary 2 ай бұрын
It should sir, I push working code. Make sure the env is correct with mongo string and your database name. All the best.
@SonuSingh-sm7jy
@SonuSingh-sm7jy 2 ай бұрын
@@tapasadhikary did not work i tried 20 times , i clone your git repo then it not still register post request working then i trigger register button ,then it will triger login api why is that happens sir?
@anandsrivastav1428
@anandsrivastav1428 Ай бұрын
code is not worked on production mode
@tapasadhikary
@tapasadhikary Ай бұрын
Yes due to the mongodb adapter is still not compatible to run there… alternate way could be to write an API with node or express and store the user data with that… however I hope it gets fixed sooner.
@anandsrivastava3494
@anandsrivastava3494 Ай бұрын
This is not work in production mode
@tapasadhikary
@tapasadhikary Ай бұрын
Yes due to the mongodb adapter is still not compatible to run there… alternate way could be to write an API with node or express and store the user data with that… however I hope it gets fixed sooner.
@MohammadNazim-nm8pf
@MohammadNazim-nm8pf 2 ай бұрын
Can you please make a video on keeping the session and using the session authentication in client pages after logging in?
@tapasadhikary
@tapasadhikary 2 ай бұрын
Yes that video will come around 7th July. Already planned. Thanks.
Next.js Middleware Crash Course || App Router Protected Routes
1:01:02
tapaScript by Tapas Adhikary
Рет қаралды 7 М.
Refresh Token Rotation With Next-Auth V5 || Managing Tokens With A Custom Backend
48:28
tapaScript by Tapas Adhikary
Рет қаралды 3,3 М.
Running With Bigger And Bigger Feastables
00:17
MrBeast
Рет қаралды 205 МЛН
Apple peeling hack
00:37
_vector_
Рет қаралды 85 МЛН
So Cute 🥰
00:17
dednahype
Рет қаралды 45 МЛН
Dynamic Colors Themes and Modes in Next.js + Shadcn UI (2024)
5:52
The Dev Logger
Рет қаралды 2,4 М.
Next.js Authentication With Next-Auth V5 || Google & GitHub
37:29
tapaScript by Tapas Adhikary
Рет қаралды 11 М.
Setting up a production ready VPS is a lot easier than I thought.
29:50
We built the Biggest iPhone in the World.
23:30
Mrwhosetheboss
Рет қаралды 3,4 МЛН
Next Auth - JWT & Session Callback & How to Update User Session
31:34
Brett Westwood - Software Engineer
Рет қаралды 47 М.
Next-Auth on App Router - Solid Auth, Super Fast
17:20
Jack Herrington
Рет қаралды 113 М.
Running With Bigger And Bigger Feastables
00:17
MrBeast
Рет қаралды 205 МЛН