diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 8a02576ff..3eee43116 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -500,7 +500,7 @@ } } }, - "panel_forgot_password": { + "forgot_password": { "message": "Forgot Password?" }, "panel_help_panel_header": { diff --git a/app/Account/AccountReducer.js b/app/Account/AccountReducer.js index 148070774..48076f6b0 100644 --- a/app/Account/AccountReducer.js +++ b/app/Account/AccountReducer.js @@ -18,7 +18,9 @@ import { GET_USER_SUCCESS, GET_USER_SETTINGS_SUCCESS, GET_USER_SUBSCRIPTION_DATA_FAIL, - GET_USER_SUBSCRIPTION_DATA_SUCCESS + GET_USER_SUBSCRIPTION_DATA_SUCCESS, + RESET_PASSWORD_SUCCESS, + RESET_PASSWORD_FAIL } from './AccountConstants'; import { UPDATE_PANEL_DATA } from '../panel/constants/constants'; @@ -28,6 +30,8 @@ const initialState = { user: null, userSettings: null, subscriptionData: null, + toastMessage: '', + resetPasswordError: false }; export default (state = initialState, action) => { @@ -84,6 +88,31 @@ export default (state = initialState, action) => { subscriptionData }); } + case RESET_PASSWORD_SUCCESS: { + const toastMessage = t('banner_check_your_email_title'); + return Object.assign({}, state, { + toastMessage, + resetPasswordError: false + }); + } + case RESET_PASSWORD_FAIL: { + const { errors } = action.payload; + let errorText = t('server_error_message'); + errors.forEach((err) => { + switch (err.code) { + case '10050': + case '10110': + errorText = t('banner_email_not_in_system_message'); + break; + default: + errorText = t('server_error_message'); + } + }); + return Object.assign({}, state, { + toastMessage: errorText, + resetPasswordError: true + }); + } default: return state; } diff --git a/app/hub/Views/LogInView/LogInView.jsx b/app/hub/Views/LogInView/LogInView.jsx index 6e76b3462..6e1cba87d 100644 --- a/app/hub/Views/LogInView/LogInView.jsx +++ b/app/hub/Views/LogInView/LogInView.jsx @@ -90,6 +90,13 @@ const LogInView = (props) => { {t('hub_login_label_password_invalid')} )} +