Skip to content

Commit

Permalink
Merge pull request #1068 from bprize15/fix-reactivate-account
Browse files Browse the repository at this point in the history
create activation key before sending email
  • Loading branch information
zhx828 authored Dec 21, 2023
2 parents 605bca4 + 43fc3f9 commit e2fd26c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ public void resendVerification(@RequestBody LoginVM loginVM, HttpServletRequest
// if (rs.getStatusCode() == HttpStatus.OK) {
Optional<User> userOptional = userService.getUserWithAuthoritiesByLogin(loginVM.getUsername());
if (userOptional.isPresent() && passwordEncoder.matches(loginVM.getPassword(), userOptional.get().getPassword())) {
if (StringUtils.isEmpty(userOptional.get().getActivationKey())) {
userService.generateNewActivationKey(userOptional.get());
}
mailService.sendActivationEmail(userMapper.userToUserDTO(userOptional.get()));
}
// }
Expand Down

0 comments on commit e2fd26c

Please sign in to comment.