diff --git a/packages/components-faraday/src/components/Login/LoginPage.js b/packages/components-faraday/src/components/Login/LoginPage.js new file mode 100644 index 0000000000000000000000000000000000000000..6ea37a256aa262136cdfef1e72b8cb04cbfeaa1a --- /dev/null +++ b/packages/components-faraday/src/components/Login/LoginPage.js @@ -0,0 +1,17 @@ +import Login from 'pubsweet-component-login/LoginContainer' +import { connect } from 'react-redux' +import { withProps, lifecycle, compose } from 'recompose' +import { actions } from 'pubsweet-client' + +const LoginPage = compose( + connect(null, { logoutUser: actions.logoutUser }), + withProps({ passwordReset: true }), + lifecycle({ + componentDidMount() { + const { logoutUser } = this.props + logoutUser() + }, + }), +)(Login) + +export default LoginPage diff --git a/packages/xpub-faraday/app/routes.js b/packages/xpub-faraday/app/routes.js index f30eeddbf00c2f50dbae317506b7d8c5ad2e291b..ae7f6e6409763c8dbbaa162403ea7e087937c500 100644 --- a/packages/xpub-faraday/app/routes.js +++ b/packages/xpub-faraday/app/routes.js @@ -1,12 +1,11 @@ import React from 'react' -import { withProps } from 'recompose' import { Route, Switch } from 'react-router-dom' import { AuthenticatedComponent } from 'pubsweet-client' -import Login from 'pubsweet-component-login/LoginContainer' import { Wizard } from 'pubsweet-component-wizard/src/components' import { ManuscriptPage } from 'pubsweet-component-manuscript/src/components' import DashboardPage from 'pubsweet-components-faraday/src/components/Dashboard' +import LoginPage from 'pubsweet-components-faraday/src/components/Login/LoginPage' import { NotFound, InfoPage, @@ -27,8 +26,6 @@ import { import FaradayApp from './FaradayApp' -const LoginPage = withProps({ passwordReset: true })(Login) - const PrivateRoute = ({ component: Component, ...rest }) => ( <Route {...rest}