aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIndrajith K L2019-12-11 19:04:14 +0530
committerIndrajith K L2019-12-11 19:04:14 +0530
commitf41d980fd83ab7da5804efd8aa7e914e820797d6 (patch)
tree9d8fa06a85d5e624cdc41693ffb3e1f9e26a752d /src/core
parent8988233da897e8447a1dbdb700836fb8576e5e6b (diff)
downloadreact-redux-saga-starter-f41d980fd83ab7da5804efd8aa7e914e820797d6.tar.gz
react-redux-saga-starter-f41d980fd83ab7da5804efd8aa7e914e820797d6.tar.bz2
react-redux-saga-starter-f41d980fd83ab7da5804efd8aa7e914e820797d6.zip
Permission Router - In-Progress
Diffstat (limited to 'src/core')
-rw-r--r--src/core/custom.router.js5
-rw-r--r--src/core/permission.router.js4
2 files changed, 6 insertions, 3 deletions
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 }) => {
<Route
{...xProps}
render={props => {
- 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 <Redirect to="/dashboard" />;
}
- debugger
- return <Component {...props} />;
+ return <Component {...returnProps} />;
}}
/>
);
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