Remove authCheck dead code.

This commit is contained in:
Daniel Ternyak 2017-04-24 19:03:08 -05:00
parent 5f11991b7f
commit fa18b408cd

View File

@ -10,24 +10,13 @@ export default class Root extends Component {
routes: PropTypes.func routes: PropTypes.func
}; };
authCheck(nextState, replace, callback) {
let {store} = this.props
let {loggedIn} = store.getState().auth
let authPath = '/auth'
if (!loggedIn) {
replace(authPath)
}
callback()
}
render() { render() {
const {store, history, routes} = this.props; const {store, history, routes} = this.props;
// key={Math.random()} = hack for HMR from https://github.com/webpack/webpack-dev-server/issues/395 // key={Math.random()} = hack for HMR from https://github.com/webpack/webpack-dev-server/issues/395
return ( return (
<Provider store={store} key={Math.random()}> <Provider store={store} key={Math.random()}>
<Router history={history} key={Math.random()}> <Router history={history} key={Math.random()}>
{routes(::this.authCheck)} {routes()}
</Router> </Router>
</Provider> </Provider>
); );