• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EcrituresNumeriques / stylo / 15066626824

16 May 2025 10:41AM UTC coverage: 37.574% (-0.02%) from 37.594%
15066626824

Pull #1517

github

web-flow
Merge e05a1c169 into 607ffe7f9
Pull Request #1517: Mise à jour vers react-router@7

549 of 776 branches covered (70.75%)

Branch coverage included in aggregate %.

13 of 373 new or added lines in 28 files covered. (3.49%)

5 existing lines in 4 files now uncovered.

5319 of 14841 relevant lines covered (35.84%)

2.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/front/src/components/PrivateRoute.jsx
1
import React from 'react'
×
NEW
2
import { Navigate, Outlet, useLocation } from 'react-router'
×
3
import { useActiveUserId } from '../hooks/user.js'
×
4

5
/**
6
 * @param {{redirectTo: string, withOutlet: boolean} & React.PropsWithChildren} props
7
 * @returns {React.ReactElement}
8
 */
NEW
9
export default function PrivateRoute({
×
NEW
10
  redirectTo = '/login',
×
NEW
11
}) {
×
NEW
12
  const activeUserId = useActiveUserId()
×
NEW
13
  const location = useLocation()
×
14

NEW
15
  return activeUserId ? (
×
NEW
16
      <Outlet />
×
17
  ) : (
NEW
18
    <Navigate to={redirectTo} state={{ returnTo: location }} />
×
19
  )
NEW
20
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc