@RequestMapping(value="/account/change_password",method=RequestMethod.POST,produces=MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> changePassword(@RequestBody PasswordChangeDTO passwordChange){
  if (StringUtils.isEmpty(passwordChange.getNewPassword()) || StringUtils.isEmpty(passwordChange.getOldPassword())) {
    return new ResponseEntity<>(HttpStatus.FORBIDDEN);
  }
  if (userService.checkPassword(passwordChange.getOldPassword())) {
    userService.changePassword(passwordChange.getNewPassword());
    return new ResponseEntity<>(HttpStatus.OK);
  }
 else {
    return new ResponseEntity<>(HttpStatus.FORBIDDEN);
  }
}

@ RequestMapping ( value = "/account/change_password" , method = RequestMethod . POST , produces = MediaType . APPLICATION_JSON_VALUE ) @ Timed public ResponseEntity < ? > changePassword ( @ RequestBody PasswordChangeDTO passwordChange ) { if ( StringUtils . isEmpty ( passwordChange . getNewPassword ( ) ) || StringUtils . isEmpty ( passwordChange . getOldPassword ( ) ) ) { return new ResponseEntity < > ( HttpStatus . FORBIDDEN ) ; } if ( userService . checkPassword ( passwordChange . getOldPassword ( ) ) ) { userService . changePassword ( passwordChange . getNewPassword ( ) ) ; return new ResponseEntity < > ( HttpStatus . OK ) ; } else { return new ResponseEntity < > ( HttpStatus . FORBIDDEN ) ; } }
post / change_password - > changes the current user ' s password
