Prevent user to send merge request email to itself
This commit is contained in:
parent
5d01519415
commit
f5533e1b95
|
@ -69,14 +69,16 @@ public class MergeEmailConfirmationManager {
|
|||
public void sendConfirmationEmail(String email, Principal principal, UUID userId, Integer provider) throws HasConfirmedEmailException {
|
||||
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
||||
|
||||
apiContext.getUtilitiesService().getConfirmationEmailService().createMergeConfirmationEmail(
|
||||
databaseRepository.getLoginConfirmationEmailDao(),
|
||||
apiContext.getUtilitiesService().getMailService(),
|
||||
email,
|
||||
userId,
|
||||
principal,
|
||||
provider
|
||||
);
|
||||
if (user.getEmail() != null && !user.getEmail().equals(email)) {
|
||||
apiContext.getUtilitiesService().getConfirmationEmailService().createMergeConfirmationEmail(
|
||||
databaseRepository.getLoginConfirmationEmailDao(),
|
||||
apiContext.getUtilitiesService().getMailService(),
|
||||
email,
|
||||
userId,
|
||||
principal,
|
||||
provider
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
Loading…
Reference in New Issue