use of com.willshex.blogwt.client.api.user.event.ChangePasswordEventHandler.ChangePasswordFailure in project blogwt by billy1380.
the class UserController method changeUserPassword.
/**
* @param actionCode
* @param newPassword
*/
public void changeUserPassword(String actionCode, String newPassword) {
final ChangePasswordRequest input = ApiHelper.setAccessCode(new ChangePasswordRequest());
input.session = SessionController.get().sessionForApiCall();
input.resetCode = actionCode;
input.changedPassword = newPassword;
// change password should take a user parameter
ApiHelper.createUserClient().changePassword(input, new AsyncCallback<ChangePasswordResponse>() {
@Override
public void onSuccess(ChangePasswordResponse output) {
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new ChangePasswordSuccess(input, output), UserController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new ChangePasswordFailure(input, caught), UserController.this);
}
});
}
use of com.willshex.blogwt.client.api.user.event.ChangePasswordEventHandler.ChangePasswordFailure in project blogwt by billy1380.
the class UserController method changeUserPassword.
public void changeUserPassword(Long userId, String password, String newPassword) {
final ChangePasswordRequest input = ApiHelper.setAccessCode(new ChangePasswordRequest());
input.session = SessionController.get().sessionForApiCall();
input.password = password;
input.changedPassword = newPassword;
// change password should take a user parameter
ApiHelper.createUserClient().changePassword(input, new AsyncCallback<ChangePasswordResponse>() {
@Override
public void onSuccess(ChangePasswordResponse output) {
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new ChangePasswordSuccess(input, output), UserController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new ChangePasswordFailure(input, caught), UserController.this);
}
});
}
Aggregations