MCPcopy Create free account
hub / github.com/Bitbox-Connect/Bitbox / ProtectedRoute

Function ProtectedRoute

client/src/component/ProtectedRoute.jsx:3–11  ·  view source on GitHub ↗
({ loggedin, children })

Source from the content-addressed store, hash-verified

1
2import { Navigate } from 'react-router-dom'
3export default function ProtectedRoute({ loggedin, children }) {
4 console.log(loggedin);
5 if (loggedin) {
6 return children
7 }
8 else {
9 return <Navigate to="/login" />
10 }
11}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected