use of org.broadleafcommerce.profile.core.service.handler.PasswordUpdatedHandler in project BroadleafCommerce by BroadleafCommerce.
the class CustomerServiceImpl method resetPassword.
@Override
@Transactional(TransactionUtils.DEFAULT_TRANSACTION_MANAGER)
public Customer resetPassword(PasswordReset passwordReset) {
Customer customer = readCustomerByUsername(passwordReset.getUsername());
String newPassword = PasswordUtils.generateSecurePassword(passwordReset.getPasswordLength());
customer.setUnencodedPassword(newPassword);
customer.setPasswordChangeRequired(passwordReset.getPasswordChangeRequired());
customer = saveCustomer(customer);
for (PasswordUpdatedHandler handler : passwordResetHandlers) {
handler.passwordChanged(passwordReset, customer, newPassword);
}
return customer;
}
use of org.broadleafcommerce.profile.core.service.handler.PasswordUpdatedHandler in project BroadleafCommerce by BroadleafCommerce.
the class CustomerServiceImpl method changePassword.
@Override
@Transactional(TransactionUtils.DEFAULT_TRANSACTION_MANAGER)
public Customer changePassword(PasswordChange passwordChange) {
Customer customer = readCustomerByUsername(passwordChange.getUsername());
customer.setUnencodedPassword(passwordChange.getNewPassword());
customer.setPasswordChangeRequired(passwordChange.getPasswordChangeRequired());
customer = saveCustomer(customer);
for (PasswordUpdatedHandler handler : passwordChangedHandlers) {
handler.passwordChanged(passwordChange, customer, passwordChange.getNewPassword());
}
return customer;
}
Aggregations