Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Learn how to implement protected routes and role-based authorization in React using React Router v6 in this comprehensive tutorial. Discover the process of setting up basic routing, creating a useAuth hook, and developing RequireAuth components. Explore techniques for managing browser history, testing with backend authentication, and applying role-based routing. Master the implementation of object lookup for roles and gain insights into testing role-based routes. Conclude with valuable information on handling unauthorized access, equipping you with the skills to create secure and user-specific areas within your React applications.
Syllabus
Intro
Welcome and Startup
Install React Router v6
Update index.js with RRv6
Basic Routing Setup
useAuth hook
RequireAuth component v1
Manage browser history
Testing with backend authentication
RequireAuth component v2
Applying Role-Based Routing
Object lookup for roles
Testing role-based routes
Last note on the Unauthorized component
Taught by
Dave Gray