Skip to content

Conversation

@Gyuhyeok99
Copy link
Contributor

관련 이슈

작업 내용

리프레시 토큰 만료시 쿠키 삭제를 삭제하는 로직을 추가하였습니다.

image

set-cookie에서 잘 삭제된 것을 확인할 수 있습니다.

특이 사항

리뷰 요구사항 (선택)

  1. 기존에 controller 삭제 관련 로직이 없었습니다. 이를 어떻게 하는 게 좋을까요? 예를들어 로그아웃 시에도 리프레시 토큰을 삭제하는 로직이 있는데 이에 대해 검증하는 것이 없습니다. 그래서 이를 mock을 활용해서 테스트를 하는 게 좋을지 고민이 되네요..

  2. 쿠키제거시에 HttpServletResponse를 활용해야하기에 service로직에서 이를 처리하는 건 조금 어긋난다고 생각하여 우선 controller 계층에서 try-catch를 활용해서 해결했습니다. 클로드 피셜 이 방식이 제일 나을 거 같다고 하긴 하는데..(이유는 reissue api에서만 리프레시 토큰을 검증하기 때문에) 이를 그냥 CustomExceptionHandler에서 처리하는 게 좋을지.. 아니면 AuthController 내에서 @ExceptionHandler를 사용하는 게 나을지 고민되긴 하네요

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

Walkthrough

1.\tAuthController 서명 포맷이 단순화되었습니다.
2.\tCustomException에 private final ErrorCode errorCode 필드가 추가되었습니다.
3.\t새로운 예외 클래스 AuthExceptionCustomException을 확장하여 추가되었습니다.
4.\tAuthService의 리프레시 토큰 검증 실패 시 던지는 예외가 CustomException에서 AuthException으로 변경되었습니다.
5.\tCustomExceptionHandler에 AuthException 처리 핸들러가 추가되어 특정 에러 코드일 때 리프레시 토큰 쿠키 삭제를 수행합니다.
6.\t단위 테스트에서 유효하지 않은 리프레시 토큰에 대한 기대 예외 타입이 AuthException으로 변경되었습니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • wibaek
  • lsy1307
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경사항(리프레시 토큰 만료시 쿠키 삭제)을 명확하게 반영하고 있으며, 간결하고 구체적입니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르며 관련 이슈, 작업 내용, 검토 요구사항을 포함하고 있습니다.
Linked Issues check ✅ Passed 코드 변경사항이 #627의 요구사항(리프레시 토큰 만료시 쿠키 삭제)을 충족하며, AuthException 추가와 CustomExceptionHandler의 처리 로직이 이를 구현합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 리프레시 토큰 만료시 쿠키 삭제라는 핵심 목표와 관련되어 있으며, 이를 지원하는 구조적 개선입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Member

@whqtker whqtker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다 !

지금 구현도 충분히 괜찮은데, 컨트롤러에서의 try catch는 어색하게 다가오기는 하네요 ..! 그렇다고 지금 핸들러에서 처리하기엔 CustomException 용 핸들러에서 쿠키 삭제 로직을 수행하는 게 어색하게 다가오기도 합니다 ㅠㅠ

개인적으로 생각한 건 인증/인가 용 예외 처리 클래스 AuthException 을 만들어 따로 처리하는 게 베스트같은데, 이 방법은 어떻게 생각하시나요 ?

@sukangpunch
Copy link
Contributor

sukangpunch commented Jan 31, 2026

확인했습니다 !

지금 구현도 충분히 괜찮은데, 컨트롤러에서의 try catch는 어색하게 다가오기는 하네요 ..! 그렇다고 지금 핸들러에서 처리하기엔 CustomException 용 핸들러에서 쿠키 삭제 로직을 수행하는 게 어색하게 다가오기도 합니다 ㅠㅠ

개인적으로 생각한 건 인증/인가 용 예외 처리 클래스 AuthException 을 만들어 따로 처리하는 게 베스트같은데, 이 방법은 어떻게 생각하시나요 ?

저도 AuthException 클래스를 만들고 ControllerAdvice를 활용해서 처리하는 방식에 대해 동의합니다!

@Gyuhyeok99 Gyuhyeok99 merged commit d85576d into solid-connection:develop Feb 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: 리프레쉬 토큰 만료시 쿠키 제거

3 participants