Last change
on this file since 5528b99 was e6c2521, checked in by darsov2 <62809499+darsov2@…>, 9 months ago |
images upload/download impl, other fixes
|
-
Property mode
set to
100644
|
File size:
300 bytes
|
Rev | Line | |
---|
[e6c2521] | 1 | import React from 'react'
|
---|
| 2 | import { Navigate } from 'react-router-dom'
|
---|
| 3 | import {useAuth} from "../Context/AuthContext";
|
---|
| 4 |
|
---|
| 5 | function PrivateRoute({ children }) {
|
---|
| 6 | const { userIsAuthenticated } = useAuth()
|
---|
| 7 | return userIsAuthenticated() ? children : <Navigate to="/login" />
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 | export default PrivateRoute |
---|
Note:
See
TracBrowser
for help on using the repository browser.