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()
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Navigate to="/dashboard" replace />
|
||||
return <Navigate to="/" replace />
|
||||
}
|
||||
return <>{children}</>
|
||||
}
|
||||
@@ -143,7 +143,7 @@ function AppRoutes() {
|
||||
<AppLayout onSearch={handleSearch} onSearchNavigate={handleSearchNavigate}>
|
||||
<Suspense fallback={<Loading />}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to="/dashboard" replace />} />
|
||||
<Route index element={<Navigate to="dashboard" replace />} />
|
||||
<Route path="dashboard" element={<DashboardPage />} />
|
||||
<Route path="gateway" element={<GatewayPage />} />
|
||||
<Route path="health" element={<HealthPage />} />
|
||||
|
||||
Reference in New Issue
Block a user