Skip Login
How to set Dashboards First page instead Login
This section explains how to set the Dashboard page as the default starting page, skipping the Login page, for cases where it is not needed.
Open the file:
src\app\page.tsxand edit the code below.
To:
// @next
import dynamic from 'next/dynamic';
// @project
const AuthLayout = dynamic(() => import('@/layouts/AuthLayout'));
const AuthLogin = dynamic(() => import('@/views/auth/login'));
/*************************** MAIN - DEFAULT PAGE ***************************/
export default function Home() {
return (
<AuthLayout>
<AuthLogin />
</AuthLayout>
);
}
import PropTypes from 'prop-types';
// @next
import dynamic from 'next/dynamic';
// @project
import { AuthProvider } from '@/contexts/AuthContext';
const AdminLayout = dynamic(() => import('@/layouts/AdminLayout'));
// const AuthGuard = dynamic(() => import('@/utils/route-guard/AuthGuard'));
// const RoleGuard = dynamic(() => import('@/utils/route-guard/RoleGuard'));
/*************************** LAYOUT - ADMIN ***************************/
export default function Layout({ children }) {
return (
<AuthProvider>
{/* <AuthGuard>
<RoleGuard> */}
<AdminLayout>{children}</AdminLayout>
{/* </RoleGuard>
</AuthGuard> */}
</AuthProvider>
);
}
Layout.propTypes = { children: PropTypes.any };Last updated