Skip to content

Commit

Permalink
HotFix: 로그아웃 시 멤버가 없으면 로그아웃 안되는 에러 해결 (#178)
Browse files Browse the repository at this point in the history
fix: 멤버가 탈퇴한 경우에도 로그아웃 가능하도록 수정
  • Loading branch information
GitJIHO authored Nov 6, 2024
1 parent c6a0c0d commit 40f045c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ public RegisterResponse registerNewMember(String name, String phoneNumber, Strin

public void memberLogout(Long memberId) {
Member member = memberRepository.findById(memberId)
.orElseThrow(() -> new NotFoundException("id에 해당하는 멤버가 없습니다."));
.orElseThrow(null);

if (member == null) {
return;
}

String storedRefreshToken = (String) redisTemplate.opsForHash().get(member.getEmail(), "refreshToken");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void memberLogoutTestWhenMemberIsNull() {
when(memberRepository.findById(memberId)).thenReturn(Optional.empty());

//when, then
assertThrows(NotFoundException.class, () -> memberService.memberLogout(memberId));
assertThrows(NullPointerException.class, () -> memberService.memberLogout(memberId));
}

@Test
Expand Down

0 comments on commit 40f045c

Please sign in to comment.