Add authentification
This commit is contained in:
@@ -12,6 +12,8 @@ import { Contract } from "./pages/Contract";
|
||||
import { NotFound } from "./pages/NotFound";
|
||||
import Contracts from "./pages/Contracts";
|
||||
import { Help } from "./pages/Help";
|
||||
import { Login } from "./pages/Login";
|
||||
import { Auth } from "./components/Auth";
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
@@ -22,29 +24,36 @@ export const router = createBrowserRouter([
|
||||
{ index: true, Component: Home },
|
||||
{ path: "/forms", Component: Forms },
|
||||
{
|
||||
path: "/dashboard",
|
||||
Component: Dashboard,
|
||||
element: <Auth />,
|
||||
children: [
|
||||
{ path: "help", Component: Help },
|
||||
{ path: "productors", Component: Productors },
|
||||
{ path: "productors/create", Component: Productors },
|
||||
{ path: "productors/:id/edit", Component: Productors },
|
||||
{ path: "products", Component: Products },
|
||||
{ path: "products/create", Component: Products },
|
||||
{ path: "products/:id/edit", Component: Products },
|
||||
{ path: "contracts", Component: Contracts },
|
||||
{ path: "users", Component: Users },
|
||||
{ path: "users/create", Component: Users },
|
||||
{ path: "users/:id/edit", Component: Users },
|
||||
{ path: "forms", Component: Forms },
|
||||
{ path: "forms/:id/edit", Component: Forms },
|
||||
{ path: "forms/create", Component: Forms },
|
||||
{ path: "shipments", Component: Shipments },
|
||||
{ path: "shipments/:id/edit", Component: Shipments },
|
||||
{ path: "shipments/create", Component: Shipments },
|
||||
{
|
||||
path: "/dashboard",
|
||||
Component: Dashboard,
|
||||
children: [
|
||||
{ path: "help", Component: Help },
|
||||
{ path: "productors", Component: Productors },
|
||||
{ path: "productors/create", Component: Productors },
|
||||
{ path: "productors/:id/edit", Component: Productors },
|
||||
{ path: "products", Component: Products },
|
||||
{ path: "products/create", Component: Products },
|
||||
{ path: "products/:id/edit", Component: Products },
|
||||
{ path: "contracts", Component: Contracts },
|
||||
{ path: "contracts/download", Component: Contracts },
|
||||
{ path: "users", Component: Users },
|
||||
{ path: "users/create", Component: Users },
|
||||
{ path: "users/:id/edit", Component: Users },
|
||||
{ path: "forms", Component: Forms },
|
||||
{ path: "forms/:id/edit", Component: Forms },
|
||||
{ path: "forms/create", Component: Forms },
|
||||
{ path: "shipments", Component: Shipments },
|
||||
{ path: "shipments/:id/edit", Component: Shipments },
|
||||
{ path: "shipments/create", Component: Shipments },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{ path: "/form/:id", Component: Contract },
|
||||
{ path: "/auth/login", Component: Login },
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user