diff options
Diffstat (limited to 'app/client/auth/auth.gate.js')
| -rw-r--r-- | app/client/auth/auth.gate.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/app/client/auth/auth.gate.js b/app/client/auth/auth.gate.js index 087dfc6..07ab399 100644 --- a/app/client/auth/auth.gate.js +++ b/app/client/auth/auth.gate.js @@ -14,21 +14,15 @@ import { randint } from '../util/math' class AuthRouter extends Component { render(){ + console.log(this.props, Login) return ( <BrowserRouter> <div> <div className="diamond"></div> <Switch> - <Route exact path='/' component={Login} /> - <Route exact path='/login' component={Login} /> - <Route exact path='/logout' component={Logout} /> - <Route exact path='/signup' component={Signup} /> - <Route component={props => { - this.props.actions.setReturnTo(props.location.pathname) - return ( - <Redirect to="/login" /> - ) - }} /> + <Route path='/logout' component={Logout} /> + <Route path='/signup' component={Signup} /> + <Route component={Login} /> </Switch> </div> </BrowserRouter> @@ -41,11 +35,12 @@ class AuthRouter extends Component { class AuthGate extends Component { render(){ + console.log(this.props.auth) if (!this.props.auth.initialized) { return <div className='loading'>Loading</div> } if (this.props.auth.isAuthenticated) return <div>{this.props.children}</div> - return <AuthRouter {...this.props} /> + return <AuthRouter /> } componentDidMount(){ this.props.actions.checkin() @@ -61,3 +56,11 @@ const mapDispatchToProps = (dispatch) => ({ }); export default connect(mapStateToProps, mapDispatchToProps)(AuthGate); + + // <Route component={props => { + // console.log(window.location.pathname) + // this.props.actions.setReturnTo(window.location.pathname) + // return ( + // <Redirect to="/login" /> + // ) + // }} />
\ No newline at end of file |
