Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

React Persistent User Login Authentication with JWT Tokens

Dave Gray via YouTube

Overview

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This intermediate tutorial adds persistent user login to a React application with JWT access and refresh tokens, using a secure HTTP-only cookie rather than local or session storage. It implements refresh, logout, device trust, expired-token handling, and a memory-leak fix in an existing authentication app.

Syllabus

Intro
Welcome Discussion
Current state of the app
Why want a persistent login?
PersistLogin component
useRefreshToken update
Add PersistLogin to App
Test the Persistent Login
Security Issue #1
useLogout hook
Add logout to Home
Test with no refresh cookie
Test with a refresh token
Test with an expired refresh token
Security Issue #2
Adding new state to AuthProvider
PersistLogin update
Login update
Test Trust Device toggle
Fix a memory leak

Taught by

Dave Gray

Reviews

Start your review of React Persistent User Login Authentication with JWT Tokens

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.