Merge branch 'Document_Manag' of https://git.marcoaiot.com/admin/marco.pms.web into Document_Manag
This commit is contained in:
commit
1b98c60120
@ -44,10 +44,14 @@ import MainRegisterPage from "../pages/authentication/MainRegisterPage";
|
||||
import MainForgetPage from "../pages/authentication/MainForgetPage";
|
||||
import MainResetPasswordPage from "../pages/authentication/MainResetPasswordPage";
|
||||
import TenantPage from "../pages/Tenant/TenantPage";
|
||||
|
||||
import { Navigate } from "react-router-dom";
|
||||
import RootRedirect from "./RootRedirect";
|
||||
const router = createBrowserRouter(
|
||||
[
|
||||
// { path: "/", element: <LandingPage /> },
|
||||
{
|
||||
path: "/",
|
||||
element: <RootRedirect />,
|
||||
},
|
||||
{
|
||||
element: <AuthLayout />,
|
||||
children: [
|
||||
@ -73,8 +77,6 @@ const router = createBrowserRouter(
|
||||
{ path: "/project/manage/:projectId", element: <ManageProject /> },
|
||||
{ path: "/employees", element: <EmployeeList /> },
|
||||
{ path: "/employee/:employeeId", element: <EmployeeProfile /> },
|
||||
// { path: "/employee/manage", element: <ManageEmp /> },
|
||||
// {path: "/employee/manage/:employeeId", element: <ManageEmp />},
|
||||
{ path: "/directory", element: <Directory /> },
|
||||
{ path: "/inventory", element: <Inventory /> },
|
||||
{ path: "/activities/attendance", element: <AttendancePage /> },
|
||||
|
13
src/router/RootRedirect.jsx
Normal file
13
src/router/RootRedirect.jsx
Normal file
@ -0,0 +1,13 @@
|
||||
import React from "react";
|
||||
import { Navigate } from "react-router-dom";
|
||||
|
||||
const RootRedirect = () => {
|
||||
const isAuthenticated = !!localStorage.getItem("jwtToken");
|
||||
return isAuthenticated ? (
|
||||
<Navigate to="/dashboard" replace />
|
||||
) : (
|
||||
<Navigate to="/auth/login" replace />
|
||||
);
|
||||
};
|
||||
|
||||
export default RootRedirect;
|
@ -1,7 +1,7 @@
|
||||
export const THRESH_HOLD = 48; // hours
|
||||
export const DURATION_TIME = 10; // minutes
|
||||
export const ITEMS_PER_PAGE = 20;
|
||||
export const OTP_EXPIRY_SECONDS = 600 // OTP time
|
||||
export const OTP_EXPIRY_SECONDS = 300 // OTP time
|
||||
|
||||
export const MANAGE_MASTER = "588a8824-f924-4955-82d8-fc51956cf323";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user