Last active
November 25, 2017 15:49
-
-
Save hoony-o-1/8413ef0576fd02f01e7f7c3b795a8b11 to your computer and use it in GitHub Desktop.
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
| const ProtectedComponent = ({ Component, path }) => { | |
| switch (this.state.token) { | |
| case '': | |
| return <DefaultLayout path={path} Component={LoadingContainer} /> | |
| case 'UNAUTHORIZED': | |
| return <Redirect to="/login" /> | |
| default: | |
| return <DefaultLayout path={path} component={Component} /> | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment