diff --git a/src/redux/configure-store.js b/src/redux/configure-store.js index 64578768..27b1c475 100644 --- a/src/redux/configure-store.js +++ b/src/redux/configure-store.js @@ -26,6 +26,7 @@ import { appVersionMiddleware, reloadFeedMiddleware, draftsMiddleware, + resetPasswordCompleteMiddleware, } from './middlewares'; import * as reducers from './reducers'; @@ -50,6 +51,7 @@ const middleware = [ realtimeMiddleware, appearanceMiddleware, initialWhoamiMiddleware, + resetPasswordCompleteMiddleware, subscriptionMiddleware, onResponseMiddleware, betaChannelMiddleware, diff --git a/src/redux/middlewares.js b/src/redux/middlewares.js index 529bc5f9..11e5e105 100644 --- a/src/redux/middlewares.js +++ b/src/redux/middlewares.js @@ -873,6 +873,13 @@ export const initialWhoamiMiddleware = (store) => (next) => (action) => { next(action); }; +export const resetPasswordCompleteMiddleware = () => (next) => (action) => { + if (action.type === response(ActionTypes.RESET_PASSWORD)) { + browserHistory.push('/signin'); + } + next(action); +}; + /** * Completes incomplete post comments states *