Skip to content

Instantly share code, notes, and snippets.

@hamiltondanielb
Created July 14, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamiltondanielb/83e82761f8e3d2394eed89d5a77ff06b to your computer and use it in GitHub Desktop.
Save hamiltondanielb/83e82761f8e3d2394eed89d5a77ff06b to your computer and use it in GitHub Desktop.
React Authorization
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