Skip to content

Commit

Permalink
[COZY-466] fix: 메일 인증 여부 반환에서 에러 임시조치
Browse files Browse the repository at this point in the history
  • Loading branch information
eple0329 authored Jan 7, 2025
1 parent aad7eea commit c419168
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.cozymate.cozymate_server.domain.mail.dto.response.VerifyResponseDTO;
import com.cozymate.cozymate_server.domain.mail.repository.MailRepository;
import com.cozymate.cozymate_server.domain.member.Member;
import com.cozymate.cozymate_server.domain.member.enums.Role;
import com.cozymate.cozymate_server.domain.member.repository.MemberRepository;
import com.cozymate.cozymate_server.domain.university.University;
import com.cozymate.cozymate_server.domain.university.repository.UniversityRepository;
Expand Down Expand Up @@ -80,12 +81,20 @@ public VerifyResponseDTO verifyMemberUniversity(MemberDetails memberDetails,
}

public String isVerified(Member member) {
Optional<MailAuthentication> mailAuthentication = mailRepository.findById(member.getId());

if (mailAuthentication.isPresent() && Boolean.TRUE.equals(
mailAuthentication.get().getIsVerified())) {
return mailAuthentication.get().getMailAddress();
if(Role.USER_VERIFIED.equals(member.getRole())) {
Optional<MailAuthentication> mailAuthentication = mailRepository.findById(
member.getId());
if (mailAuthentication.isPresent()){
return mailAuthentication.get().getMailAddress();
}
}
// TODO: 인증했을 때 getIsVerified가 변경되지 않아서 문제 발생 -> 일단 조치
// Optional<MailAuthentication> mailAuthentication = mailRepository.findById(
// member.getId());
// if (mailAuthentication.isPresent() && Boolean.TRUE.equals(
// mailAuthentication.get().getIsVerified())) {
// return mailAuthentication.get().getMailAddress();
// }
return "";
}

Expand Down

0 comments on commit c419168

Please sign in to comment.