Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 26, 2024
1 parent 33c2a67 commit d06391f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public MailSend(AuthCodeRepository authCodeRepository, JavaMailSender javaMailSe
private static final Random rand = new Random();

public Mono<Void> execute(AuthCodeRequest request) {
Mono<User> userMono = userFacade.findByEmail(request.mail())
String mail = request.mail();

Mono<User> userMono = userFacade.findByEmail(mail)
.flatMap(user -> {
if (Objects.equals(request.type(), MailType.CHANGE_PW.getType())) {
return Mono.empty();
Expand All @@ -54,7 +56,6 @@ public Mono<Void> execute(AuthCodeRequest request) {
});

String authCode = getRandomCode();
String mail = request.mail();

Mono<Void> sendMailMono = sendMail(mail, authCode).subscribeOn(scheduler);
Mono<Void> saveAuthCodeMono = saveAuthCode(mail, authCode).subscribeOn(scheduler);
Expand Down

0 comments on commit d06391f

Please sign in to comment.