Skip to content

[Fix] 로그아웃, 세션 무효화 시 FCM 토큰 정리 - #424

Merged
howooyeon merged 4 commits into
developfrom
fix/#423-fcm-token-cleanup
Sep 7, 2026
Merged

howooyeon merged 4 commits into
developfrom
fix/#423-fcm-token-cleanup

Conversation

@howooyeon

@howooyeon howooyeon commented Sep 6, 2026 •

Copy link
Copy Markdown
Member

🧾 요약

  • 로그아웃·세션 무효화 시 FCM 토큰을 정리해, 로그아웃된 기기 잠금화면에 이전 사용자의 알림 내용이 뜨는 문제를 막는다

🔗 이슈

✨ 변경 내용

  • AuthService.login, OAuthLoginProcessor.login에서 토큰 발급 후 해당 유저의 FCM 토큰 정리
  • AuthService.logout에서도 동일 처리 — 기존에는 블랙리스트 등록과 refresh 삭제만 했다
  • TokenRedisService에 단일 세션이 의도임을 명시하고, 기기별 세션으로 바꿀 때 함께 손봐야 할 지점을 남김
  • 로그인·로그아웃 정리와 재발급 미정리 검증 테스트 추가

AuthService.reissue도 issueTokens를 호출하지만 여기서는 정리하지 않는다. 재발급은 같은 세션의 연장이라 지우면 푸시가 영구히 끊긴다. reissueDoesNotClearFcmTokens로 고정해 뒀다

💬 참고

탈퇴는 이미 UserWithdrawCleanupDispatcher에서 정리하고 있어 변경이 없습니다

DELETE /api/fcm/tokens 요청 본문은 { "token": "기기 FCM 토큰" } 하나입니다 (deviceType 아님). 서버가 정리하므로 클라에서 반드시 호출할 필요는 없습니다

✅ 확인

  • 빌드 OK
  • 테스트 OK (전체 스위트)
  • logout의 정리 호출을 제거하면 logoutClearsFcmTokens가 실패하는 것 확인

@howooyeon howooyeon added the bug Something isn't working label Sep 6, 2026
@howooyeon howooyeon self-assigned this Sep 6, 2026
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 0a172a53-385e-41af-b03e-1dcdca6b24f4

📥 Commits

Reviewing files that changed from the base of the PR and between 2548c35 and cb48870.

📒 Files selected for processing (5)
  • src/main/java/com/semosan/api/common/jwt/TokenRedisService.java
  • src/main/java/com/semosan/api/domain/auth/service/AuthService.java
  • src/main/java/com/semosan/api/domain/oauth/service/OAuthLoginProcessor.java
  • src/test/java/com/semosan/api/domain/auth/service/AuthServiceTest.java
  • src/test/java/com/semosan/api/domain/oauth/service/OAuthLoginProcessorTest.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@howooyeon howooyeon changed the title fix: 로그아웃·세션 무효화 시 FCM 토큰 정리 (#423) [Fix] 로그아웃, 세션 무효화 시 FCM 토큰 정리 Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📊 테스트 커버리지 리포트

Overall Project 98.45% 🍏
Files changed 100% 🍏

File Coverage
TokenRedisService.java 100% 🍏
OAuthLoginProcessor.java 100% 🍏
AuthService.java 100% 🍏

@howooyeon
howooyeon merged commit c1c9a04 into develop Sep 7, 2026
5 checks passed
@howooyeon
howooyeon deleted the fix/#423-fcm-token-cleanup branch September 7, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 로그아웃, 세션 무효화 시 FCM 토큰 정리

1 participant