diff options
Diffstat (limited to 'app/client')
| -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> ) |
