Added sagas + pages for password reset. WIP BOD-165

This commit is contained in:
Patrick Fic
2020-07-20 13:52:24 -07:00
parent e6865a4bfc
commit d2aa72f5d9
15 changed files with 427 additions and 3 deletions

View File

@@ -9,6 +9,11 @@ const INITIAL_STATE = {
fingerprint: null,
error: null,
conflict: false,
passwordreset: {
email: null,
error: null,
success: false,
},
};
const userReducer = (state = INITIAL_STATE, action) => {
@@ -19,6 +24,25 @@ const userReducer = (state = INITIAL_STATE, action) => {
return { ...state, conflict: false };
case UserActionTypes.SET_INSTANCE_CONFLICT:
return { ...state, conflict: true };
case UserActionTypes.VALIDATE_PASSWORD_RESET_START:
case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_START:
return {
...state,
passwordreset: {
email: action.payload,
error: null,
success: false,
},
};
case UserActionTypes.VALIDATE_PASSWORD_RESET_FAILURE:
case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_FAILURE:
return { ...state, passwordreset: { error: action.payload } };
case UserActionTypes.VALIDATE_PASSWORD_RESET_SUCCESS:
case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_SUCCESS:
return {
...state,
passwordreset: { ...state.passwordreset, success: true },
};
case UserActionTypes.SIGN_IN_SUCCESS:
return {
...state,