AuthGuard.jsx 443 B

12345678910111213141516171819
  1. /* import React from 'react'
  2. import { Route, Redirect } from 'react-router-dom'
  3. import {connect } from 'react-redux'
  4. const PrivateRoute = ({ component: Component, token, ...rest }) => (
  5. <Route {...rest} render={(props) => (
  6. token
  7. ? <Component {...props} />
  8. : <Redirect to={{
  9. pathname: '/login',
  10. state: { from: props.location }
  11. }} />
  12. )} />
  13. )
  14. export default connect(null)(PrivateRoute) */