Skip to content

Commit

Permalink
[SHIBUI-1031]
Browse files Browse the repository at this point in the history
Added password encryption on POST.
  • Loading branch information
Bill Smith committed Jan 7, 2019
1 parent 541ba5d commit 4fcd7eb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ ResponseEntity<?> saveOne(@RequestBody User user) {
.body(new ErrorResponse(String.valueOf(HttpStatus.CONFLICT.value()),
String.format("A user with username [%s] already exists within the system.", user.getUsername())));
}
user.setPassword(BCrypt.hashpw(user.getPassword(), BCrypt.gensalt()));
userRoleService.updateUserRole(user);
//TODO: encrypt password? Or is it sent to us encrypted?
User savedUser = userRepository.save(user);
return ResponseEntity.ok(savedUser);
}
Expand Down

0 comments on commit 4fcd7eb

Please sign in to comment.