Created
June 24, 2018 10:40
-
-
Save AndrejGajdos/9ca6bfc98bf62abb5ad0074a3f74f112 to your computer and use it in GitHub Desktop.
This file is part of project https://github.com/AndrejGajdos/auth-flow-spa-node-react
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 { Switch, Route } from 'react-router-dom'; | |
import Cookies from 'js-cookie'; | |
import { Redirect } from 'react-router'; | |
import { AsyncHomeView, AsyncAboutView } from 'asyncViews'; | |
export default function Routes() { | |
return ( | |
<Switch> | |
<Route path="/" exact component={AsyncHomeView} /> | |
<Route path="/about" component={AsyncAboutView} /> | |
<Route | |
path="/facebook/success/" | |
render={() => ( | |
<Redirect | |
to={{ | |
pathname: Cookies.get('lastLocation_before_logging'), | |
state: { loadUser: true }, | |
}} | |
/> | |
)} | |
/> | |
</Switch> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment