Aim was to create a hoc file to check for token and admin but the hoc routing does not work in react router v4+. I have added the below link as reference
So I created Privates route with the new approach mentioned in the article. Now the user can only view protected routes when they have a token and user can only view admin panel if their isAdmin prop is set to true
ISSUE #18
Aim was to create a hoc file to check for token and admin but the hoc routing does not work in react router v4+. I have added the below link as reference
https://medium.com/today-i-learned-chai/protect-route-in-react-router-using-hoc-got-dispatching-infinity-loop-59999a2d7c12
So I created Privates route with the new approach mentioned in the article. Now the user can only view protected routes when they have a token and user can only view admin panel if their isAdmin prop is set to true
Please check the PR and comment for changes