fix: nested route navigation — use relative paths, redirect to / not /dashboard
This commit is contained in:
@@ -43,7 +43,7 @@ function RedirectIfAuth({ children }: { children: ReactNode }) {
|
|||||||
const { isAuthenticated } = useAuth()
|
const { isAuthenticated } = useAuth()
|
||||||
|
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
return <Navigate to="/dashboard" replace />
|
return <Navigate to="/" replace />
|
||||||
}
|
}
|
||||||
return <>{children}</>
|
return <>{children}</>
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ function AppRoutes() {
|
|||||||
<AppLayout onSearch={handleSearch} onSearchNavigate={handleSearchNavigate}>
|
<AppLayout onSearch={handleSearch} onSearchNavigate={handleSearchNavigate}>
|
||||||
<Suspense fallback={<Loading />}>
|
<Suspense fallback={<Loading />}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route index element={<Navigate to="/dashboard" replace />} />
|
<Route index element={<Navigate to="dashboard" replace />} />
|
||||||
<Route path="dashboard" element={<DashboardPage />} />
|
<Route path="dashboard" element={<DashboardPage />} />
|
||||||
<Route path="gateway" element={<GatewayPage />} />
|
<Route path="gateway" element={<GatewayPage />} />
|
||||||
<Route path="health" element={<HealthPage />} />
|
<Route path="health" element={<HealthPage />} />
|
||||||
|
|||||||
Reference in New Issue
Block a user