Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Refreshing Access Token When It Expires (Session + JWT)
Play lesson

Node JS Tutorial for Beginners in Hindi - 2025 - Refreshing Access Token When It Expires (Session + JWT)

5.0 (2)
26 learners

What you'll learn

This course includes

  • 35.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

🔥 Access Source Code, PPT & Notes here for Free : https://www.thapatechnical.com/2024/11/introduction-to-nodejs.html 💸 Get All My YouTube Videos' Source Code for just ₹249! Grab Now - https://thapatechnical.shop/source-code ----------------------------------------------------------------------- In this video, we are implementing a secure token refresh mechanism to handle expired or missing access tokens using JWT & Sessions. If the access token is invalid or has expired but the refresh token is still valid, we will generate new access & refresh tokens and store them securely in cookies. 📺 Watch the complete Node.JS Playlist here :https://youtube.com/playlist?list=PLwGdqUZWnOp3KELplHtc-RnJ5xTUPqdgH&si=_ob8F88HYxCdspup You will learn: ✅ How access & refresh tokens work in authentication ✅ What happens when an access token expires ✅ Extracting tokens from cookies and verifying them ✅ Fetching session and user details from the database ✅ Generating a new access & refresh token dynamically ✅ Storing tokens securely in cookies ✅ Running & testing the authentication flow in a real app ✅ What happens to tokens when the user logs out ---------------------------------------------------------------- 🚀 Boost Your Skills with these Pre-Requisite Videos: 🔗 Best HTML Course - https://youtu.be/5ccq_nLHneE 🔗 Best CSS Course - https://youtu.be/MSICFljRcb4 🔗 JavaScript Basics Course Part 1 - https://youtu.be/13gLB6hDHR8 🔗 JavaScript Advanced Course Part 2 - https://youtu.be/YwsOCN8woA8 ------------------------------------------------------------------------ 💸 Build Your Own E-commerce Website for Free! - https://www.thapatechnical.com/2024/03/build-complete-ecommerce-website-using.html ------------------------------------------------------------------------ ✌️ Join Us! 🚀 Become a Member: Unlock perks, free source code, and more Join Now : https://www.youtube.com/channel/UCwfaAHy4zQUb2APNOGXUCCA/join 📷 Connect on Instagram: https://www.instagram.com/thapatechnical 🗨️ Join Our Discord Server: Hang out with fellow programmers Discord Link: https://discord.gg/MdScmCsua6 ------------------------------------------------------------------------ ⌛TIMELINE⏳ 0:00 - Introduction: Refreshing Access & Refresh Tokens 📍 1:50 - Step-by-Step Guide to Refreshing Tokens 📍 6:10 - What Happens When the Access Token Expires? (Theory) 📍 7:02 - Understanding Database Structure for Refresh Tokens 📍 8:15 - Get the Source Code for Free 📍 9:30 - Where Is the verifyAuthentication Function Used? 📍 10:40 - Extracting access_token and refresh_token from Cookies 📍 12:45 - Handling Cases When an Access Token Is Present 📍 14:25 - If the Access Token Is Missing or Invalid, Let’s Refresh It 📍 17:15 - Fetching the Session from the Database Using ID 📍 20:00 - Fetching the User from the Database Using ID 📍 22:00 - Generating a New Access & Refresh Token 📍 24:35 - Storing Both Tokens Securely in Cookies 📍 25:00 - Quick Recap of What We Did 📍 26:40 - Running the App & Testing the Refresh Token Flow 📍 29:00 - What Happens to Tokens When We Logout?

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

FAQs

Course Hive
Download CourseHive
Keep learning anywhere