From 3043751ba11a38ebd9f03416fd7f4600dae41f1a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 17 Sep 2018 13:24:41 +0200 Subject: production routing shit --- app/client/auth/auth.gate.js | 4 ++++ app/client/auth/auth.reducer.js | 1 + app/client/index.jsx | 25 +++++++++++++++---------- 3 files changed, 20 insertions(+), 10 deletions(-) (limited to 'app/client') 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
Loading
} 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
Launching app
} + console.log('rendering as normal') return
{this.props.children}
} return 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 { diff --git a/app/client/index.jsx b/app/client/index.jsx index 33e4148..0b0ed05 100644 --- a/app/client/index.jsx +++ b/app/client/index.jsx @@ -19,20 +19,25 @@ const module_list = Object.keys(modules).map(name => { ) }) +const ModuleRouter = () => { + return ( + + ) +} + const app = ( -
- - - - - {module_list} - - - - +
+
{console.log(props.location.pathname)}
} /> + + + + { console.log('pziss'); }} /> + { console.log('pziss'); }} /> + {module_list} +
-- cgit v1.2.3-70-g09d2