diff --git a/src/routes.jsx b/src/routes.jsx index 67ebc1384..d30c7a702 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -17,6 +17,14 @@ const LoginRedirect = withProps({ redirectTo: `${ACCOUNTS_APP_LOGIN_URL}?retUrl=${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}` })(RedirectComponent) +const redirectToConnect = (nextState, replace, callback) => { + if(window.location.hostname.indexOf('connectv2') === 0) { + window.location.assign(window.location.href.replace('connectv2', 'connect')) + return + } + callback() +} + const redirectToProject = (nextState, replace, callback) => { const feedId = nextState.params.feedId getFreshToken().then(() => { @@ -50,7 +58,7 @@ const redirectToProject = (nextState, replace, callback) => { } export default ( - window.scrollTo(0, 0)} component={ App }> + window.scrollTo(0, 0)} component={ App } onEnter={ redirectToConnect }>