Skip to content

Commit

Permalink
Merge pull request #41 from c0smosaur/dev
Browse files Browse the repository at this point in the history
[FIX] 이메일 검증 오류 수정
  • Loading branch information
c0smosaur authored May 29, 2024
2 parents 24c49c4 + 8cacb6d commit 7878fb6
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.core.linkup.member.request.validate.PasswordValidationRequest;
import com.core.linkup.member.request.validate.UsernameValidationRequest;
import com.core.linkup.security.MemberDetails;
import jakarta.mail.MessagingException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.password.PasswordEncoder;
Expand All @@ -29,13 +30,13 @@ public class ValidationService {
public void sendEmailAuthCodeByEmail(EmailValidationRequest request) {
String subject = "LinkUp 이메일 인증번호";
String authCode = authCodeUtils.createEmailAuthCode();
try{
validateEmail(request);

validateEmail(request);
try {
emailUtils.sendEmail(request.email(), subject, authCode);
redisUtils.saveEmailAuthCode(request.email(), authCode);
} catch (Exception e) {
log.error("messaging error");
throw new BaseException(BaseResponseStatus.EMAIL_ERROR);
} catch (MessagingException e) {
log.error(e.getMessage());
}
}

Expand Down

0 comments on commit 7878fb6

Please sign in to comment.