function checkAuth(nextState, replace, cb) {
  let loginUserData = window.localStorage.getItem("token")
  if(!loginUserData){
    replace({
      pathname: '/login',
      state: { nextPathname: nextState.location.pathname }
    });
    cb();
  }
  cb();
}
/*Here I have implemented the token based auth!!*/
Here I have implemented the token based auth
Here I have implemented the token based auth
function checkAuth(nextState, replace, cb) {
  let loginUserData = window.localStorage.getItem("token")
  if(!loginUserData){
    replace({
      pathname: '/login',
      state: { nextPathname: nextState.location.pathname }
    });
    cb();
  }
  cb();
}
function checkAuth ( nextState , replace , cb ) { let loginUserData = window . localStorage . getItem ( "token" ) if ( ! loginUserData ) { replace ( { pathname : '/login' , state : { nextPathname : nextState . location . pathname } } ) ; cb ( ) ; } cb ( ) ; }
Here I have implemented the token based auth!
Here I have implemented the token based auth!