scrimba
Frontend Career Path
Advanced React
React Router
Protected Routes - Implementing "auth" (FDCP)
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Protected Routes - Implementing "auth" (FDCP)
AboutCommentsNotes
Protected Routes - Implementing "auth" (FDCP)
Expand for more info
AuthRequired.jsx
run
preview
console
import React from "react"
import { Outlet } from "react-router-dom"

export default function AuthRequired() {
// Check the authenticated status of the user
// If they're NOT authenticated
// send the user to the login page
// If they ARE authenticated
// Render the Outlet
return <Outlet />
}
Console
/protected
-2:25