Skip to content

Commit

Permalink
✨ 회원 탈퇴 시 refresh token 삭제
Browse files Browse the repository at this point in the history
서버-클라 사이에 사용되는 refresh token
  • Loading branch information
min-0 committed Oct 16, 2024
1 parent 20ce9c9 commit f8a6138
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

import com.dnd.dndtravel.auth.domain.RefreshToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface RefreshTokenRepository extends JpaRepository<RefreshToken, Long> {
RefreshToken findByMemberId(Long memberId);
void deleteByMemberId(Long memberId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dnd.dndtravel.member.service;

import com.dnd.dndtravel.auth.repository.RefreshTokenRepository;
import com.dnd.dndtravel.map.repository.MemberAttractionRepository;
import com.dnd.dndtravel.map.repository.MemberRegionRepository;
import com.dnd.dndtravel.auth.service.MemberNameGenerator;
Expand All @@ -19,6 +20,7 @@ public class MemberService {
private final MemberAttractionRepository memberAttractionRepository;
private final MemberRegionRepository memberRegionRepository;
private final MemberNameGenerator memberNameGenerator;
private final RefreshTokenRepository refreshTokenRepository;

@Transactional
public Member saveMember(String email, String selectedColor) {
Expand All @@ -34,6 +36,7 @@ public void withdrawMember(long memberId) {

memberAttractionRepository.deleteByMemberId(memberId);
memberRegionRepository.deleteByMemberId(memberId);
refreshTokenRepository.deleteByMemberId(memberId);
memberRepository.delete(member);
}

Expand Down

0 comments on commit f8a6138

Please sign in to comment.