Created
July 14, 2016 16:35
-
-
Save hamiltondanielb/83e82761f8e3d2394eed89d5a77ff06b to your computer and use it in GitHub Desktop.
React Authorization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Route, IndexRoute } from 'react-router'; | |
import { requireAuth } from './utils/auth'; | |
import App from './components/App'; | |
import Login from './containers/LoginPage'; | |
import TeamPage from './containers/TeamPage'; // eslint-disable-line import/no-named-as-default | |
import NotFoundPage from './components/NotFoundPage.js'; | |
export default ( | |
<Route path="/" component={App}> | |
<Route path="/login" component={Login}/> | |
<IndexRoute component={TeamPage} onEnter={requireAuth}/> | |
<Route path="*" component={NotFoundPage}/> | |
</Route> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment