From ead4b13ba5f7955dd565db3d48c0dbe03c4d21d9 Mon Sep 17 00:00:00 2001
From: kattoczko <50657366+kattoczko@users.noreply.github.com>
Date: Fri, 16 Feb 2024 14:15:25 +0000
Subject: [PATCH] feat: Show /login directly on / without valid authentication
(#1528)
---
packages/web/src/routes.tsx | 225 +++++++++++++++++++-----------------
1 file changed, 117 insertions(+), 108 deletions(-)
diff --git a/packages/web/src/routes.tsx b/packages/web/src/routes.tsx
index 23274fc9..e764004a 100644
--- a/packages/web/src/routes.tsx
+++ b/packages/web/src/routes.tsx
@@ -1,4 +1,4 @@
-import { Route, Routes, Navigate } from 'react-router-dom';
+import { Route, Routes as ReactRouterRoutes, Navigate } from 'react-router-dom';
import Layout from 'components/Layout';
import PublicLayout from 'components/PublicLayout';
import Applications from 'pages/Applications';
@@ -17,127 +17,136 @@ import * as URLS from 'config/urls';
import settingsRoutes from './settingsRoutes';
import adminSettingsRoutes from './adminSettingsRoutes';
import Notifications from 'pages/Notifications';
+import useAuthentication from 'hooks/useAuthentication';
-export default (
-
-
-
-
- }
- />
+function Routes() {
+ const { isAuthenticated } = useAuthentication();
-
-
-
- }
- />
+ return (
+
+
+
+
+ }
+ />
-
-
-
- }
- />
+
+
+
+ }
+ />
-
-
-
- }
- />
+
+
+
+ }
+ />
-
-
-
- }
- />
+
+
+
+ }
+ />
-
-
-
- }
- />
+
+
+
+ }
+ />
- } />
+
+
+
+ }
+ />
-
-
-
- }
- />
+ } />
- }
- />
+
+
+
+ }
+ />
-
-
-
- }
- />
+ } />
-
-
-
- }
- />
+
+
+
+ }
+ />
-
-
-
- }
- />
+
+
+
+ }
+ />
-
-
-
- }
- />
+
+
+
+ }
+ />
- } />
+
+
+
+ }
+ />
- {settingsRoutes}
+
+ }
+ />
- {adminSettingsRoutes}
+ {settingsRoutes}
-
- 404
-
- }
- />
-
-);
+ {adminSettingsRoutes}
+
+
+ 404
+
+ }
+ />
+
+ );
+}
+
+export default ;