Ejemplo n.º 1
0
 /** POST /change_password -> changes the current user's password */
 @RequestMapping(
     value = "/account/change_password",
     method = RequestMethod.POST,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<?> changePassword(@RequestBody String password) {
   if (!checkPasswordLength(password)) {
     return new ResponseEntity<>("Incorrect password", HttpStatus.BAD_REQUEST);
   }
   userService.changePassword(password);
   return new ResponseEntity<>(HttpStatus.OK);
 }