Skip to content

Commit 48a45ab

Browse files
committed
added protected route
1 parent e0e56b5 commit 48a45ab

File tree

1 file changed

+10
-9
lines changed
  • thingconnect.pulse.client/src/router

1 file changed

+10
-9
lines changed

thingconnect.pulse.client/src/router/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { lazy } from 'react';
22
import { createBrowserRouter, Navigate } from 'react-router-dom';
33
import { AppShell } from '@/components/layout/AppShell';
44
import { LazyWrapper } from '@/components/LazyWrapper';
5+
import { ProtectedRoute } from '@/features/auth/components/ProtectedRoute';
56

67
// Lazy load page components for code splitting
78
const Dashboard = lazy(() => import('@/pages/Dashboard'));
@@ -47,9 +48,9 @@ export const router = createBrowserRouter([
4748
{
4849
path: '/',
4950
element: (
50-
// <ProtectedRoute>
51-
<AppShell />
52-
// </ProtectedRoute>
51+
<ProtectedRoute>
52+
<AppShell />
53+
</ProtectedRoute>
5354
),
5455
children: [
5556
{
@@ -90,9 +91,9 @@ export const router = createBrowserRouter([
9091
{
9192
path: '/configuration',
9293
element: (
93-
// <ProtectedRoute adminOnly>
94-
<AppShell />
95-
// </ProtectedRoute>
94+
<ProtectedRoute adminOnly>
95+
<AppShell />
96+
</ProtectedRoute>
9697
),
9798
children: [
9899
{
@@ -108,9 +109,9 @@ export const router = createBrowserRouter([
108109
{
109110
path: '/settings',
110111
element: (
111-
// <ProtectedRoute adminOnly>
112-
<AppShell />
113-
// </ProtectedRoute>
112+
<ProtectedRoute adminOnly>
113+
<AppShell />
114+
</ProtectedRoute>
114115
),
115116
children: [
116117
{

0 commit comments

Comments
 (0)