From: charleswrayjr Date: Mon, 15 Sep 2025 04:40:13 +0000 (-0500) Subject: Fixing it so nobody can see anything if they aren't logged in. X-Git-Url: https://git.phasecustomsoft.com/?a=commitdiff_plain;h=f6db5a093e45d9df7d6db81ca9e578dc987d379d;p=phs-admin.git Fixing it so nobody can see anything if they aren't logged in. --- diff --git a/src/app/routes.js b/src/app/routes.js index 8547ad6..fc3cd83 100755 --- a/src/app/routes.js +++ b/src/app/routes.js @@ -12,28 +12,34 @@ import MediaView from './views/Media/MediaView'; import MediaFormView from './views/Media/MediaFormView'; import PostsView from './views/Posts/PostsView'; import PostFormView from './views/Posts/PostFormView'; +import { useContext } from 'react'; +import { AuthContext } from './components/AuthContext'; export default function AppRoutes() { + const { user } = useContext( AuthContext ); + const privateRoutes = [ + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } />, + } /> + ] return ( - } /> } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> + { user?.id && privateRoutes } ); };