Dashboard as First Page
How to set Dashboardas First page instead landing
Last updated
How to set Dashboardas First page instead landing
Last updated
This section explains how to set the Dashboard page as the default starting page, skipping the landing page, for cases where it is not needed.
Update route at: src/routes/index.tsx
// import { lazy } from 'react';
import { useRoutes } from 'react-router-dom';
// project-imports
// import CommonLayout from 'layout/CommonLayout';
// import Loadable from 'components/Loadable';
import ComponentsRoutes from './ComponentsRoutes';
// import LoginRoutes from './LoginRoutes';
Add default dashboard route: src/routes/MainRoutes.tsx
...
const MainRoutes = {
path: '/',
children: [
{
path: '/',
element: <DashboardLayout />,
children: [
{
path: '/',
element: <DashboardDefault />
},
{
path: 'dashboard',
children: [
{
path: 'default',
element: <DashboardDefault />
},
....
]
}
...
]
},
]
}
Comment out the AuthGuard
wrapper for the routes within the Dashboard
element:
// import AuthGuard from 'utils/route-guard/AuthGuard';
...
...
return (
// <AuthGuard>
<Box sx={{ display: 'flex', width: '100%' }}>
<Header />
...
</Box>
// </AuthGuard>
)
Disabling authentication within the system would render certain applications non-functional, particularly those reliant on backend APIs. These applications require a valid token to access and load data seamlessly.