diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 13:24:41 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 13:24:41 +0200 |
| commit | 3043751ba11a38ebd9f03416fd7f4600dae41f1a (patch) | |
| tree | bef7fdef47182814a10c73b2f6799c46e8462b58 /app/client/auth | |
| parent | f3f84961eb9ddf3dacfb3e4bf5c56504303c048f (diff) | |
production routing shit
Diffstat (limited to 'app/client/auth')
| -rw-r--r-- | app/client/auth/auth.gate.js | 4 | ||||
| -rw-r--r-- | app/client/auth/auth.reducer.js | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/app/client/auth/auth.gate.js b/app/client/auth/auth.gate.js index 574feb3..2bbbc6d 100644 --- a/app/client/auth/auth.gate.js +++ b/app/client/auth/auth.gate.js @@ -43,18 +43,22 @@ class AuthRouter extends Component { class AuthGate extends Component { render(){ if (!this.props.auth.initialized) { + console.log('loading auth') return <div className='loading'>Loading</div> } if (this.props.auth.isAuthenticated) { + console.log('authenticated...') if (this.props.auth.returnTo) { let { returnTo } = this.props.auth if (!returnTo || returnTo.match(/(login|logout|signup)/i)) { returnTo = '/' } + console.log('history.push', returnTo) this.props.actions.setReturnTo(null) history.push(returnTo) return <div>Launching app</div> } + console.log('rendering as normal') return <div>{this.props.children}</div> } return <AuthRouter {...this.props} /> diff --git a/app/client/auth/auth.reducer.js b/app/client/auth/auth.reducer.js index 80b1ec5..a56f94a 100644 --- a/app/client/auth/auth.reducer.js +++ b/app/client/auth/auth.reducer.js @@ -11,6 +11,7 @@ const authInitialState = { } const auth = (state = authInitialState, action) => { + console.log(action) switch(action.type) { case types.auth.set_token: return { |
