Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Nov 1, 2023
1 parent 624a4d6 commit 9f08290
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void register(@RequestBody @Valid EditUserDTO userAccountDTO) {

userService.checkLoginIsFree(userAccountDTO);
if(!userService.checkEmailIsFree(userAccountDTO)){
LOGGER.warn("Skipping the whole registration process because email '{}' is already taken", userAccountDTO.email());
return; // we care for user email leak
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public com.github.nkonev.aaa.dto.EditUserDTO editProfile(
return UserAccountConverter.convertToEditUserDto(exists);
}

private UserAccount findUserAccount(@AuthenticationPrincipal UserAccountDetailsDTO userAccount) {
private UserAccount findUserAccount(UserAccountDetailsDTO userAccount) {
return userAccountRepository.findById(userAccount.getId()).orElseThrow(() -> new RuntimeException("Authenticated user account not found in database"));
}

Expand Down

0 comments on commit 9f08290

Please sign in to comment.