diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 13:29:40 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 13:29:40 +0200 |
| commit | 53c658d996c56fe28775319367bffa45dd7db641 (patch) | |
| tree | 7d912c336b78f87622a79c04063504676e8a56ed /app/client/auth/auth.gate.js | |
| parent | f730c0f282cd506c94afd991dd9127fd54b27ad6 (diff) | |
auth gate must have its own switch
Diffstat (limited to 'app/client/auth/auth.gate.js')
| -rw-r--r-- | app/client/auth/auth.gate.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/app/client/auth/auth.gate.js b/app/client/auth/auth.gate.js index 2bbbc6d..6df1238 100644 --- a/app/client/auth/auth.gate.js +++ b/app/client/auth/auth.gate.js @@ -19,18 +19,22 @@ class AuthRouter extends Component { <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" /> - ) - }} /> - </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 path='/:module' component={props => { + switch (props.location.pathname) { + case '/login': + case '/logout': + case '/signup': + return null; + } + this.props.actions.setReturnTo(props.location.pathname) + return ( + <Redirect to="/login" /> + ) + }} /> </div> </BrowserRouter> ) |
