diff --git a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java index 7190e7d..659f29f 100644 --- a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java +++ b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java @@ -73,12 +73,18 @@ public class MemberService { Member preMember = this.memberDAO.findByEmail(member.getEmail()); - member.setPw(passwordEncoder.encode(pw)); - Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw()); - if(match) { - throw new EqualsOldPasswordException(); + if (null != pw && !pw.equals("")) { + Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw()); + if(!match) { + member.setPw(passwordEncoder.encode(pw)); + } + } else { + member.setPw(preMember.getPw()); } + if (member.getStatus() == null || member.getStatus().getId() < 0) { + member.getStatus().setId(preMember.getStatus().getId()); + } return this.memberDAO.save(member); }