Base Template
This commit is contained in:
@@ -11,6 +11,7 @@ import Register from '../pages/auth/Register';
|
||||
import ResetPassword from '../pages/auth/ResetPassword';
|
||||
import VerifyCode from '../pages/auth/VerifyCode';
|
||||
import { AuthProvider } from '../contexts/LaravelAuthContext';
|
||||
import AuthGuard from '../guards/AuthGuard';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -34,18 +35,22 @@ export default function Router() {
|
||||
path: 'login',
|
||||
element: (
|
||||
<AuthProvider>
|
||||
<Login />
|
||||
<GuestGuard>
|
||||
<Login />
|
||||
</GuestGuard>
|
||||
</AuthProvider>
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'register',
|
||||
element: (
|
||||
<AuthProvider>
|
||||
<GuestGuard>
|
||||
<RegisterForm />
|
||||
</GuestGuard>
|
||||
</AuthProvider>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// path: 'register',
|
||||
// element: (
|
||||
// <GuestGuard>
|
||||
// <RegisterForm />
|
||||
// </GuestGuard>
|
||||
// ),
|
||||
// },
|
||||
// { path: 'login-unprotected', element: <Login /> },
|
||||
// { path: 'register-unprotected', element: <Register /> },
|
||||
// { path: 'reset-password', element: <ResetPassword /> },
|
||||
@@ -58,15 +63,21 @@ export default function Router() {
|
||||
// },
|
||||
{
|
||||
path: '/',
|
||||
element: <DashboardLayout />,
|
||||
element: (
|
||||
<AuthProvider>
|
||||
<AuthGuard>
|
||||
<DashboardLayout />
|
||||
</AuthGuard>
|
||||
</AuthProvider>),
|
||||
children:[
|
||||
{ element: <Navigate to="/dashboard" replace />, index: true },
|
||||
{
|
||||
path: 'medicines',
|
||||
element: <AuthProvider><Medicines /></AuthProvider>,
|
||||
path: 'dashboard',
|
||||
element: <Dashboard />,
|
||||
},
|
||||
{
|
||||
path: 'medicines/create',
|
||||
element: <MedicinesCreate />
|
||||
path: 'members',
|
||||
element: <Members />,
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -109,6 +120,6 @@ const Login = Loadable(lazy(() => import('../pages/auth/Login')));
|
||||
const Dashboard = Loadable(lazy(() => import('../pages/Dashboard')));
|
||||
const NotFound = Loadable(lazy(() => import('../pages/Page404')));
|
||||
|
||||
// Medicines
|
||||
const Medicines = Loadable(lazy(() => import('../pages/Medicines/Index')));
|
||||
// Members
|
||||
const Members = Loadable(lazy(() => import('../pages/Members/Index')));
|
||||
const MedicinesCreate = Loadable(lazy(() => import('../pages/Medicines/Create')));
|
||||
|
||||
Reference in New Issue
Block a user