diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/app.jsx | 2 | ||||
-rw-r--r-- | client/components/router.jsx | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/client/app.jsx b/client/app.jsx index a7de3cf..e1e4c03 100644 --- a/client/app.jsx +++ b/client/app.jsx @@ -26,6 +26,8 @@ export const App = () => { setLoading(false); }, []); + // before displaying anything try getting a token using cookies, + // can display a loading screen here if desired if (loading) return null; return ( diff --git a/client/components/router.jsx b/client/components/router.jsx index fa552fc..ccdb83a 100644 --- a/client/components/router.jsx +++ b/client/components/router.jsx @@ -12,7 +12,7 @@ export const Router = () => { <Routes> <Route path="/" - element={authToken ? <Home /> : <Navigate replace to="signin" />} // no jwt means not logged in + element={authToken ? <Home /> : <Navigate replace to="signin" />} // no token means not logged in /> <Route path="signin" element={<SignIn />} /> <Route path="signup" element={<SignUp />} /> |