private void ensureCredentialsMatch(String email, String password) { UserCredentialsMatcher matcher = new UserCredentialsMatcher(database); UserEmailAddressEntity emailEntity = addressDAO.getPrimaryEmail(emailDAO.getUserByEmail(email)); UserAuthenticationInfo authinfo = UserAuthenticationInfo.createInfoFromEntity(emailEntity); UsernamePasswordToken token = new UsernamePasswordToken(email, password); assertTrue(matcher.doCredentialsMatch(token, authinfo)); }
@CommitAfter public Object onSuccessFromPasswordForm() throws IOException, HornetQException { user.createPassword(newPassword); passwordChanged = true; emailNotify.startMessage(EmailTemplate.USER_CHANGE_PASSWORD); emailNotify.setToAddress(userEmailAddressDAO.getPrimaryEmail(user).getEmail()); emailNotify.send(); return this; }