if (userService.isCorrectPassword(databaseUser, user.getCurrentPassword())) {
user.setHasChangedInitialPassword(true);
user.setLastPasswordChangedDate(new Date());
Object currentUserObject = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (currentUserObject instanceof ThreadFixUserDetails) {
ThreadFixUserDetails details = (ThreadFixUserDetails) currentUserObject;
details.setHasChangedInitialPassword(true);
}
userService.storeUser(user);
status.setComplete();
log.info("The User " + currentUserName + " has completed the password change.");
ControllerUtils.addSuccessMessage(request, "The password change was successful.");