Fix Authentication
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,22 +35,26 @@ export default function Router() {
|
||||
path: 'login',
|
||||
element: (
|
||||
<AuthProvider>
|
||||
<Login />
|
||||
<GuestGuard>
|
||||
<Login />
|
||||
</GuestGuard>
|
||||
</AuthProvider>
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'register',
|
||||
element: (
|
||||
<GuestGuard>
|
||||
<RegisterForm />
|
||||
</GuestGuard>
|
||||
<AuthProvider>
|
||||
<GuestGuard>
|
||||
<RegisterForm />
|
||||
</GuestGuard>
|
||||
</AuthProvider>
|
||||
),
|
||||
},
|
||||
{ path: 'login-unprotected', element: <Login /> },
|
||||
{ path: 'register-unprotected', element: <Register /> },
|
||||
{ path: 'reset-password', element: <ResetPassword /> },
|
||||
{ path: 'verify', element: <VerifyCode /> },
|
||||
// { path: 'login-unprotected', element: <Login /> },
|
||||
// { path: 'register-unprotected', element: <Register /> },
|
||||
// { path: 'reset-password', element: <ResetPassword /> },
|
||||
// { path: 'verify', element: <VerifyCode /> },
|
||||
],
|
||||
},
|
||||
// {
|
||||
@@ -58,7 +63,12 @@ export default function Router() {
|
||||
// },
|
||||
{
|
||||
path: '/',
|
||||
element: <AuthProvider><DashboardLayout /></AuthProvider>,
|
||||
element: (
|
||||
<AuthProvider>
|
||||
<AuthGuard>
|
||||
<DashboardLayout />
|
||||
</AuthGuard>
|
||||
</AuthProvider>),
|
||||
children:[
|
||||
{
|
||||
path: 'dashboard',
|
||||
|
||||
Reference in New Issue
Block a user