Skip to content

Commit

Permalink
[FIX] 이메일 검증 오류 수정
Browse files Browse the repository at this point in the history
- 내부에서 예외처리 x, 인증 메일이 오지 않을 경우 사용자 측에서 재시도하도록 유도
  • Loading branch information
c0smosaur committed May 29, 2024
1 parent 1e2f203 commit 8cacb6d
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 8cacb6d

Please sign in to comment.