From f41d980fd83ab7da5804efd8aa7e914e820797d6 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Wed, 11 Dec 2019 19:04:14 +0530 Subject: Permission Router - In-Progress --- src/core/custom.router.js | 5 ++--- src/core/permission.router.js | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 src/core/permission.router.js (limited to 'src/core') diff --git a/src/core/custom.router.js b/src/core/custom.router.js index b3f08ec..c6b2859 100644 --- a/src/core/custom.router.js +++ b/src/core/custom.router.js @@ -7,7 +7,7 @@ export const CustomRouter = ({ xComponent: Component, ...xProps }) => { { - console.log(props.permissions) + let returnProps = {...xProps, ...props}; let token = Storage.get("token"); let pathName = props.match.path; if (!token && pathName !== "/login") { @@ -19,8 +19,7 @@ export const CustomRouter = ({ xComponent: Component, ...xProps }) => { return ; } - debugger - return ; + return ; }} /> ); diff --git a/src/core/permission.router.js b/src/core/permission.router.js new file mode 100644 index 0000000..4047b75 --- /dev/null +++ b/src/core/permission.router.js @@ -0,0 +1,4 @@ +import React from "react"; +import { Route, Redirect } from "react-router-dom"; + +// export const Permi \ No newline at end of file -- cgit v1.2.3