Access Refresh Token, Middleware and cookies in Backend

  Рет қаралды 74,690

Chai aur Code

Chai aur Code

7 ай бұрын

Visit chaicode.com for all related materials, community help, source code etc.
Welcome to chai aur code, a coding/programming dedicated channel in Hindi language. Now you can learn best of programming concepts with industry standard practical guide in Hindi language.
All source code is available at my Github account:
github.com/hiteshchoudhary/ch...
Our Open-Source Project is here: freeapi.app
Join me at whatsapp: hitesh.ai/whatsapp
for community discord: hitesh/ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial
HTML video series: • HTML and VSCode - gett...
Complete javascript series: • Javascript for beginne...
Complete Reactjs series: • React JS roadmap | cha...
Javascript and react interview series: • 1 call se shuru hui pl...
Backend development with Javascript: • Javascript Backend Roa...

Пікірлер: 1 200
@chaiaurcode
@chaiaurcode 7 ай бұрын
A small bug in code, if (!(username || email)) . Jab video dekhoge to aa jayega smjh. GIthub pe b add kr diya h code. Next video me krte h discuss hitesh.ai/whatsapp
@ravishbisht502
@ravishbisht502 7 ай бұрын
❤❤❤❤❤❤❤❤
@AkashYadavv23
@AkashYadavv23 7 ай бұрын
Sir bas aap jaldi se achhe se recover ho jao bas ❤
@ali-wz6nz
@ali-wz6nz 7 ай бұрын
Thank You Sir, Ap apna wada pura kiye video upload karne ka.
@Abdullah-0119
@Abdullah-0119 7 ай бұрын
Aagyi 🎉 Aagyi 🎉 Aagyi 🎉 video
@munna5553
@munna5553 7 ай бұрын
Guru ❤❤
@tradictionofficial
@tradictionofficial 7 ай бұрын
Todo's for login ( dnt know if its good ) - take input from the user from the login page. - save it in a variable - apply check ( as per js series form handling part ) if the username == username && password == password . Then perform some action. - call mongodb to check the db if there is any user with the same username ( email in case ) is present or not , if not throw err . And redirect to register (dnt know how, will plan if situation arise) - if username/email present. Then get its _id and store it in variable - retreive username and pass from that variable to check if both are same or not. If no then err - if yes then redirect it to the page we want ( Dnt know the use of refresh token. Actually i didnt get it by now. I hope I will understand after seeing how u are using it ) , now continue to the video... -
@MixThisAll
@MixThisAll 7 ай бұрын
Hello Sir, after 7 years I started coding again, because of some financial issues i cannot pursue my studies, and i have to work in another field because of availability of other jobs. I manage my time at night to gain my knowledge in coding and YOU are the main reason Sir. Thank you.
@patidarji2332
@patidarji2332 6 ай бұрын
same bro
@DTALKS01
@DTALKS01 4 ай бұрын
Freelancing start kardena iske baad
@developer_dhanji
@developer_dhanji 2 ай бұрын
lage raho bro
@zia-kayani
@zia-kayani 7 ай бұрын
Login user todo 1- get values from client side 2- validation- emptiness checking 3- check user exist if not redirect to register page 4- assigning of access token 5 -login 6- success response
@abdur786_
@abdur786_ 5 ай бұрын
I have more than 4 year experience on watching tech video on KZfaq in Hindi language.....I can say that this Hindi KZfaq channel is top of all Hindi KZfaq channel.... Amazing sir aapke samjhna ka tarika pasand aaya...very beginner level. Thank you sir thank you very much❤❤
@ashishjha8154
@ashishjha8154 4 ай бұрын
I've never understood backend better until I found your videos. Their clarity and enthusiasm make learning a joy!
@ShubhankarSharma-vr6zg
@ShubhankarSharma-vr6zg 7 ай бұрын
Sir, feeling so lucky to be a part of this community. Literally, Chai and Code is an emotion 🔥🔥
@Mohammad_Faiyaj
@Mohammad_Faiyaj 7 ай бұрын
I contributed a comment, q ki Target 🎯 to achieve karna aur karvana padega na Thank you sir❤❤😊
@devpatel7302
@devpatel7302 4 ай бұрын
Steps for User to Login : 1. get data from user 2. check the data if it is not empty 3. check the data from user to match with that of database. 4. if the data is matched return true else if return false.
@NandavaramMahesh-hf4sk
@NandavaramMahesh-hf4sk 7 ай бұрын
I have learnt a lot from your backend series , how the flow happens , how to think and not rush to code, how to standardize the code , how to abstract the common logic . This series has really increased my confidence. I really appreciate your effort and your valuable time in bringing us the valuable content and trying to make us better programmers. Thanks a lot Hitesh.
@sugarfreecode
@sugarfreecode 7 ай бұрын
It's a challenge to completely understand this, because it is the very first time I'm seeing these methods, and that too a lot of them in a single video. But at least I'm getting the motive behind each action that we are taking. Thanks to you sir, we could get access to such high quality code.
@harshvardhan1214
@harshvardhan1214 5 ай бұрын
The clarity i get from watching your videos is mind blowing.
@seeyou7989
@seeyou7989 7 ай бұрын
I have 1+ years of experience in mern but still watching your backend course, looking interested never watch this type of content on any platform. Awesome 🥰
@aadarshgurug
@aadarshgurug 7 ай бұрын
same here
@JKInfosysglobal
@JKInfosysglobal 3 ай бұрын
same here
@Blackbox-tw9lr
@Blackbox-tw9lr 7 ай бұрын
1. validation of input fields 2. check if users credentials is present in db 3. compare passwords 4. generate access and refresh token 5. return response of access and refresh token in cookies thank you sir
@H_NileshKumar
@H_NileshKumar 4 ай бұрын
User ko login karne ke steps: 1. Get data from user. 1.5 . Validate the data as per your need. 2. Check if the user already exists or not , if not then give error 3.Save the email and password in jwt for further uses like not to ask the user to login again and again . Mujhe to itna hi knowledge hai abhi tak. Dhanyawad 🙏
@vikasparmar1987
@vikasparmar1987 4 ай бұрын
This is the best videos you can find on internet... University should also suggest this course students because they don't teach you like this
@shameeralibaigs.489
@shameeralibaigs.489 7 ай бұрын
Hi @hitesh, Thanks for this series. I love it :) . I wish you to plan for MERN interview guide series, it would help many ❤
@chaiaurcode
@chaiaurcode 7 ай бұрын
Already covering interview tips within these videos
@vaishnomatabhaktamandali2000
@vaishnomatabhaktamandali2000 7 ай бұрын
Great to see u back! btw we gonna make frontend for this after this series? just a random thought came into my mind as u showed us the app in the very first.
@chaiaurcode
@chaiaurcode 7 ай бұрын
Sure, we got the front end UI part ready. We can plan it. This backend is already one of the most complex available on KZfaq
@vaishnomatabhaktamandali2000
@vaishnomatabhaktamandali2000 7 ай бұрын
@@chaiaurcode I appreciate this really, not in terms of spoon-feeding, but actually I feel this will be a great answer to such people who keep asking you for "Complete Mern Stack Project".
@atharvadeshmukh6328
@atharvadeshmukh6328 3 ай бұрын
Waah sir, itna bada lecture!! Bohot achha laga pura dekh ke. kaafi kuch cheezein clear hui aur nayi nayi cheezein seekhne ko mili Thank you 😊
@Ofcl-Javed
@Ofcl-Javed 6 ай бұрын
---Login TODOs // get username or email , password from user // Check for empty fields // Check if user exists or not // fetch user from database // compare saved password and input password // if credentials are correct generate access and refresh token So far I can only figure out this and itna sbh isliye likh paaya because peechli video se mst sikh kr aaya 3-4 attempt lge smjhne m
@pushpendra10001
@pushpendra10001 7 ай бұрын
Sir ji after dhiwise and flutter flow like technology which can create flutter code very fast is learning flutter still good option I know a real developer is a person who focus on concept not on technology but I want your opinion... ❤
@adarshjhaxiif-1289
@adarshjhaxiif-1289 7 ай бұрын
Aaj toh aapke comment targets ko double karke maanenge
@MuhammadAli-hh9td
@MuhammadAli-hh9td 3 ай бұрын
4 mahinay baad double hi hugay
@mohammadhani110
@mohammadhani110 7 ай бұрын
Dear Hitesh Sir, thank you for the incredible Backend Series. Love this series. You are providing valuable knowledge and insights with industry grade practices.
@adityakodgire2300
@adityakodgire2300 9 күн бұрын
whoever is facing difficulty in understanding the video. Watch the video twice!. i faced the same problem as i was coding and watching the video at the same time , but i dedicated the second time to watch the video at 2x to understand each and every bit. now i have understood everything. thank you so much hitesh sir ♥ ♥
@rakeshbhetariya
@rakeshbhetariya 7 ай бұрын
After watching the video twice, I found it extremely insightful. It provided a superb understanding of the topic
@nikhilpatel4278
@nikhilpatel4278 7 ай бұрын
These videos have become an ADDICTION! Really a production grade code, I am guessing this can become a reference code.🙌
@mauliingle8322
@mauliingle8322 7 ай бұрын
This is backend serious help me lot of my current project and change my total coding approach.. Thank you sir.. give the lots of project related (setup) knowldage...
@NandavaramMahesh-hf4sk
@NandavaramMahesh-hf4sk 7 ай бұрын
Yes any other video will take lot of effort to reach this kind of dedication to give real real value to the community.
@mohdali-yq8gq
@mohdali-yq8gq 7 ай бұрын
Great explanation!! Such kind of tutorials are very, very hard to find and it will be game changer for the students and experienced persons as the core concepts have been explained in detail and with full explanation. Well done SIR
@jashabantadas9783
@jashabantadas9783 7 ай бұрын
Its good to have you back. Thank you for this awesome tutorial.
@rahulsoni-it7ni
@rahulsoni-it7ni 7 ай бұрын
Good to see you again sir, I hope you are feeling better now. I wanna tell you something, your teaching skills are so polished and attractive. I hope you are always here to guide us.😇😇😇😇😇😇
@krishna.vineet
@krishna.vineet 26 күн бұрын
Hats off to you sir.. Standing throughout the videos, pain in eye, still dedicated to text us.. 😮 That's great. Thanku so much 👏👏
@suyashmehare8034
@suyashmehare8034 2 ай бұрын
1. Fetch req body 2. Check if user is exist. 3. Check user crendtails are correct. 4. Generate access & refresh token. 5. Save refresh token in DB 6. Return access & refresh token to client.
@manjeetagarwal580
@manjeetagarwal580 4 ай бұрын
I could never imagine such in depth information can be found so much easily, you are really great Hitesh sir!!
@the_haryannvi_coder
@the_haryannvi_coder 7 ай бұрын
best backend ever, i am blessed i found u in this early stage in my career.
@shahriarhossain8622
@shahriarhossain8622 23 күн бұрын
Sir, the effort you put into each tutorial is highly appreciated. Hitesh sir is one of the best things I got from KZfaq. Wishing you a long life and good health from Bangladesh.🙏
@adamyasharma_0135
@adamyasharma_0135 2 ай бұрын
this was such deep and in depth lecture ,completed this in 2 days in 2 sitting ,each minute was worth it
@sayakghosh5104
@sayakghosh5104 7 ай бұрын
After a long time, nice to be back and continuing this series with you.
@vaibhavchopra5297
@vaibhavchopra5297 7 ай бұрын
Paji boht bria content h aapka best in world h abhi ke tym. Aap continue kro full support hh ❤❤🔥🔥🦅🦅
@sandypopu
@sandypopu 7 ай бұрын
Really appreciate and cannot thank you enough for these videos. Really accelerates the learning process!!
@howardjohnson-dp9eq
@howardjohnson-dp9eq 7 ай бұрын
Kisi tv series ka aisa intezar nahi Kiya jitna sir ka videos ka
@devshyamtech
@devshyamtech 7 ай бұрын
Thanku so much sir ❤❤ aap hamare liye itne cast me hone ke baad bhi hamlog ko padha rahe hai love you sir 🌹🌹
@nitinchoudhary8
@nitinchoudhary8 6 ай бұрын
Thank you for your dedication and passion for teaching. Your hard work and commitment to your students does not go unnoticed. You have made a positive impact on so many lives and your influence will continue to be felt for years to come. Thank you for all that you do.
@kushalbhargava8212
@kushalbhargava8212 7 ай бұрын
Nice video on how to use cookie, refresh token and access token Now it clear as crystal !!!
@Tech_creatition
@Tech_creatition 25 күн бұрын
apka 1 hour ka video ho ya 3 hour ka maan hi nhi bharta sir esa lagta bass dekhe jao dekhe jao ..... you are such a great
@divymodi7642
@divymodi7642 Ай бұрын
Thank you so much, sir, for the excellent Node.js backend series! 🙏✨
@varshadeogharia1277
@varshadeogharia1277 7 ай бұрын
Thank you so much sir !!! feeling grateful to study from such a great teacher .💗💗💗
@asmittyagi6250
@asmittyagi6250 4 ай бұрын
Yes Sir, pura samjh me aarha hai. Ho hi nahi sakta hi aap samjhaye or hume samjh na aaye.. 🙏🏻🙇🏻‍♂
@user-ff4vj3uh5h
@user-ff4vj3uh5h 7 ай бұрын
Back with so much knowledge. Only can do this 😎. Thank you sir and also take care ❤
@allyn3015
@allyn3015 6 ай бұрын
Hats off to your sir. Having an amazing journey with you. Bht mza aa rha hai backend pdne mai. Hope to meet you soon sir❤
@Just_for_fuuny
@Just_for_fuuny 7 ай бұрын
i am very lucky ke mujhe aap jasse teracher se shekne ka mokha mila 🥰🥰🥰🥰🥰thankyou sir ji
@FaizSultan430
@FaizSultan430 6 ай бұрын
hi sir hope u r doing well , your efforts in this series are excellent honestly, I watched it twice and after completing whole series i will watch in one go thanks you so much Sir for this production grade series
@adarsh7171
@adarsh7171 7 ай бұрын
sir bhut mja aa rha hai .. dil garden garden ho rha hai ...
@HimanshuShukla-nb6eb
@HimanshuShukla-nb6eb 7 ай бұрын
I never waited for any web series as i wait for next video of you lectures. Best course on youtube
@user-yp6dg5te2l
@user-yp6dg5te2l 7 ай бұрын
Very well explained about the concepts of refresh and access tokens, GOAT @Hitesh sir. Learning from you i am becoming better developer.
@atulverma_up45
@atulverma_up45 7 ай бұрын
thank you so much sir, your ability to impart knowledge with such passion and patience is truly commendable 🙏
@pranavkale7682
@pranavkale7682 4 ай бұрын
Thank you for explaining everything in such a great way
@manassingh9161
@manassingh9161 5 ай бұрын
Love the depth of this full free backend course
@shivkojha
@shivkojha 4 ай бұрын
For the first time, i have completed 1 hour long video in one sitting and completed in full while coding and understanding things properly. Thank you hitesh sir for making these topics so much engaging for us. Completed at 14 March 2024 5:50 pm
@mohammad-aman1105
@mohammad-aman1105 6 ай бұрын
Sir , pain hua 2 baar dekhne me lekin maza aagaya
@shivamsahu236
@shivamsahu236 3 ай бұрын
I have 1+ year experience but today I have understand this core concept true way. Thank you so much Sir 🤗
@user-mk8zz3ow4f
@user-mk8zz3ow4f 5 ай бұрын
30:39 Yes sir samajh aa raha hai sir bahut ache se aap padate hai sir I sure that none one can become like you
@user-do3iu4fp3m
@user-do3iu4fp3m 5 ай бұрын
best ever Teacher with amazing communication skill.
@bharatkumar048
@bharatkumar048 4 ай бұрын
Your Way of teaching always pull me to your channel
@PankajKumar-ue2xu
@PankajKumar-ue2xu 7 ай бұрын
🌟🌟🌟🌟🌟 Thank you so much for creating and sharing this amazing content! 🙏 Your videos have been incredibly helpful and insightful. I appreciate the time and effort you put into each video to make it both informative and engaging. Keep up the fantastic work! Looking forward to more valuable content from your channel. 👏
@chayanchandrosutrodhar1105
@chayanchandrosutrodhar1105 7 ай бұрын
Awesome teaching style !! Thank you sir
@himanshu_baghel_07
@himanshu_baghel_07 9 күн бұрын
Todo's for login 1. username/email input 2. password input 3. check user exit or not 4. if user exit assign token 5. redirect to home page
@ABHISHEKKUMARJHA-eg3hi
@ABHISHEKKUMARJHA-eg3hi 2 ай бұрын
seriously very nice content sir ..loved your teaching style 😍
@aniketkhede
@aniketkhede 7 ай бұрын
I have gone through so many tutorials but never came accross such quality content, the thing is stuffs are not tough it's the instructors who decide wether it is going to be simple aur tough. You doing great job @chaiaurcode #chaiaurcode #backenddevelopment
@Shubhamkumar-qc5hc
@Shubhamkumar-qc5hc 7 ай бұрын
Nice to see you sir🙂thank you for all these types of content you are providing to us...🙂🙂
@PrashantKumar-rx5rn
@PrashantKumar-rx5rn 7 ай бұрын
boht achhe se samjhaya apne, thanks
@AbhishekSingh-xg3zj
@AbhishekSingh-xg3zj 2 ай бұрын
Sir it's a very awesome video ❤. I am out of words to express how beautifully you have explained such heavy topic so easily. As I was getting closer to the end of video, I was falling more and more in love with the way of your teaching and explanation. Thank you so much sir for making such awesome videos for us. Hats off to you Sir. ❤
@rahulgokani5977
@rahulgokani5977 7 ай бұрын
@10:30 if we are looking for atleast one input from user that's username or email, than condition to throw error should be "&&'. If we use Or ("||") than it will throw error even though user has sent either of the options, i e. Username or email. Apart from that, thank you so much for this type of videos. 🙏🏼
@user-iv6ey3ze6g
@user-iv6ey3ze6g 7 ай бұрын
todos for a login user: 1) email and password ko pehle validate kro wrna error pass kro 2) uske bd check kro jo user ne email dia h kia exist bhi krta h ya nhi db me wrna error pass krwao 3) agar email h db me tw password ko compare karwao jo db me save h wrna invalid credentials ka error pass krwao 4) uske bd aek access token aur aek refresh token return kro user ko lekin dono tokens k secret key different rkh kr same nhi hona chaiye continue...
@Alpha-nn8mn
@Alpha-nn8mn 7 ай бұрын
JavaScript, React & now Backend followed everything religiously and gained so much knowledge, Thank you Hitesh sir.
@abc-ym4zs
@abc-ym4zs 7 ай бұрын
bro for projects whom should i follow bro
@Alpha-nn8mn
@Alpha-nn8mn 7 ай бұрын
@@abc-ym4zs never follow anyone for projects, make real projects of your own, checkout repositories of others for projects structure and then make yours.
@developmenttesting9625
@developmenttesting9625 7 ай бұрын
Today lecture is awesome. Maza Aajata s Hai sir aap ke Saath padhkar.
@user-fp3tm1jp2f
@user-fp3tm1jp2f 5 ай бұрын
I love this man the way of teaching is on another level
@yashpandey350
@yashpandey350 7 ай бұрын
Well thanks for this detailed discussion sir, I had done a complex project in past months and most of the things I've implemented in my project is getting used here too but I didn't know the reason for most of the stuffs that why are we doing this and that. For example that auth middleware I understood 20-30% implementation during my project but still not sure the reason. Now I get to know that Oh when we are logging out we actually don't have anything related to user in our req and res... Thanks sir❤❤
@sarcasticcat9876
@sarcasticcat9876 7 ай бұрын
Steps to login 1. Getting username/email and password from user 2. Checking username/e-mail and password fields 3. Getting user info from db 4. Password checking 5. Generation of acces and refresh token 6. Send cookie
@saadatbadgujar
@saadatbadgujar 4 ай бұрын
Such in depth explanation thank you!
@sagaryenkure5112
@sagaryenkure5112 7 ай бұрын
Your explanation is so good and clear . concepts are clear to understand ❤❤
@rudra9535
@rudra9535 28 күн бұрын
fantastic video. thankyou. you are a gem of teacher
@harshitthakur5541
@harshitthakur5541 7 ай бұрын
Sir, feeling so lucky to be a part of this community.
@vishal-shinde
@vishal-shinde 4 ай бұрын
6:18 1. Check if the user is not registered 2. Compare passwords in req body and db 3. Create an access token and refresh token using jwt 4. save token in cookie or DB as per requirements 5. Send response with tokens
@user-tx5ln5se9v
@user-tx5ln5se9v 7 ай бұрын
Very nicly explained. Waiting for the refresh token related video.
@ayushjain2499
@ayushjain2499 7 ай бұрын
I was having some issues regarding JWT token, after watching this video my problem is gone. Thankyou so much sir for you hard work. #chaiaurcode
@niitteenpathak3840
@niitteenpathak3840 7 ай бұрын
You are best teacher of web development❤
@its_nawed4611
@its_nawed4611 4 ай бұрын
steps to follow for user login : tried to write it before watching the whole video(might not be totally correct ) 1->get username and password from front-end( req.body) 2->check for user existence in the database using username and through 'User" object 3->validation of password 4->if all steps passed ->user login successfully At the end Thankyou so much sir for this amazing channel ❤
@AavaniVedanshi
@AavaniVedanshi 7 ай бұрын
After long awaited video.. I am fully excited now.
@sumitsaurabh4670
@sumitsaurabh4670 7 ай бұрын
I was waiting the episode. please don't discontinue this series
@user-lt4kd1qq9q
@user-lt4kd1qq9q 7 ай бұрын
Hello sir, I show when I am hit the Like button then your likes count become a 1k this surprisingly for me , thanks a lot for this valuable❤able content
@codelivewithme
@codelivewithme 7 ай бұрын
i took sir mern stack boot-camp but believe me this series and way more better then whole boot-camp.even they do teach refresh token there so i'm relearning here again
@user-ou4eq8rl8v
@user-ou4eq8rl8v 7 ай бұрын
Thanks you sir, welcome back ❤❤
@NikhilEnigma
@NikhilEnigma 7 ай бұрын
Acche content ko comment to banta hai 🤩🤩 Sir bas ase hi mast content deliver kariye ☺
@theMadProgrammers
@theMadProgrammers 7 ай бұрын
Dear studenst you can never find this production type content on paid or free course, this series is lit
@RajkumarYadav-ur3ni
@RajkumarYadav-ur3ni 6 ай бұрын
Today I watch this video, this is something next level really I enjoyed while watching this video.
@mitvavirvadiya8993
@mitvavirvadiya8993 7 ай бұрын
Sir, very excited for this Backend course
@alokeshmaitra2164
@alokeshmaitra2164 11 сағат бұрын
todos for login 1. get the data from the frontend 2. check if the user has access token 3.check if the user has refresh tocken if do not has access token 4. check in the database 5. redirect to the homepage
@Ravi71681
@Ravi71681 7 ай бұрын
Great to see u are recovering fast
@Zaheer__zk40
@Zaheer__zk40 4 ай бұрын
Thank you so much for sharing your experience with us!
Access token and refresh token in Backend
30:08
Chai aur Code
Рет қаралды 63 М.
Complete guide for router and controller with debugging
29:35
Chai aur Code
Рет қаралды 61 М.
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 91 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 38 МЛН
JWT Authentication with Access Tokens & Refresh Tokens - Node.js
37:16
Is the MERN Stack Really Dead in 2024? | What Developers need to know
16:20
JWT token vs Server Tokens
10:25
Hitesh Choudhary
Рет қаралды 30 М.
How to use postman for backend
36:13
Chai aur Code
Рет қаралды 63 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 235 М.
So, you want to be a programmer?
20:43
ForrestKnight
Рет қаралды 244 М.
Decoding Stackoverflow developer survey for Indian Developers
52:58
Chai aur Code
Рет қаралды 30 М.
The PERFECT Desi Girl 😍 | Omegle long conversations & more ❤️
21:43
Мне приснился очень страшный сон
0:38
ЖЕСТКИЙ ШАПАЛАК👋
0:33
RFC Fighting Championship
Рет қаралды 179 М.
Самый странный заключённый😂 #фильм #кино
0:56
Самый Лучший Дедушка ❤️
0:15
Глеб Рандалайнен
Рет қаралды 3,5 МЛН