2016-05-18 19:37:59 +02:00
|
|
|
import { Route, IndexRoute } from 'react-router'
|
|
|
|
import React from 'react'
|
|
|
|
import App from './containers/App'
|
|
|
|
import IDEView from './containers/IDEView/IDEView'
|
2016-05-24 07:20:59 +02:00
|
|
|
import LoginView from './containers/LoginView/LoginView'
|
2016-06-09 02:52:59 +02:00
|
|
|
import SignupView from './containers/SignupView/SignupView'
|
2016-06-15 01:11:42 +02:00
|
|
|
import { getUser } from './redux/actions/user';
|
2016-05-18 19:37:59 +02:00
|
|
|
|
2016-06-15 01:11:42 +02:00
|
|
|
const routes = (store) => {
|
|
|
|
return (
|
|
|
|
<Route path="/" component={App}>
|
|
|
|
<IndexRoute component={IDEView} onEnter={checkAuth(store)}/>
|
|
|
|
<Route path="/login" component={LoginView}/>
|
|
|
|
<Route path="/signup" component={SignupView}/>
|
|
|
|
</Route>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const checkAuth = (store) => {
|
|
|
|
store.dispatch(getUser());
|
|
|
|
}
|
2016-05-18 19:37:59 +02:00
|
|
|
|
|
|
|
export default routes;
|