Added sagas + pages for password reset. WIP BOD-165
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user