Skip to content

[#22] 로그아웃 기능 구현#35

Merged
earlgrey02 merged 6 commits intodevfrom
feature/22-logout
Feb 3, 2026
Merged

[#22] 로그아웃 기능 구현#35
earlgrey02 merged 6 commits intodevfrom
feature/22-logout

Conversation

@earlgrey02
Copy link
Member

작업 내용

  • 로그아웃 기능 구현
  • Spring Security 설정 리팩토링
  • 테스트 코드 리팩토링

관련 이슈

@earlgrey02 earlgrey02 requested review from 1117mg and mjk25 February 3, 2026 08:28
@earlgrey02 earlgrey02 self-assigned this Feb 3, 2026
@earlgrey02 earlgrey02 added feature 기능 구현 refactor 리팩토링 labels Feb 3, 2026
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🤖 Gemini Code Review

✅ 변경 사항 요약

  • Core 모듈에 ErrorType enum을 도입하여 전역 예외 처리 로직 및 오류 응답 형식을 통일했습니다.
  • 인증/인가 예외 처리기 및 전역 예외 핸들러가 하드코딩된 HTTP 상태 코드와 메시지 대신 ErrorType을 사용하도록 마이그레이션되었습니다.
  • 로그아웃 기능을 추가하고, 인증된 사용자 ID를 주입받기 위한 @AuthenticationId 어노테이션이 도입되었습니다.

✏️ 파일별 상세 리뷰

core/src/main/kotlin/com/retoday/core/global/exception/ErrorType.kt

  • 📍 Issue: 중앙화된 오류 타입 관리는 시스템의 안정성과 일관성을 높이는 필수적인 개선 사항입니다. 다만, 기존 예외 클래스들이 하드코딩된 상태 코드와 메시지를 사용하던 방식에서 완전히 전환되었는지 재차 확인해야 합니다.
  • Improvement: ErrorType에 정의되지 않은 예외가 발생할 경우를 대비하여 INTERNAL_SERVER_ERROR가 올바른 상태 코드(500)를 반환하는지 검증이 필요합니다.

core/src/main/kotlin/com/retoday/core/global/exception/ServerException.kt

  • 📍 Issue: 기존에 raw statusmessage를 받던 생성자를 제거하고 ErrorType을 받도록 강제함으로써 예외 처리의 통일성을 확보했습니다.

api/src/main/kotlin/com/retoday/api/global/exception/GlobalExceptionHandler.kt

  • 📍 Issue: 이전의 복잡했던 일반 Exception 처리 로직(클래스 이름을 파싱하여 코드 생성)을 제거하고 ErrorType.INTERNAL_SERVER_ERROR를 사용하도록 통일한 것은 바람직합니다. 모든 예외 처리기가 이제 ErrorType을 기반으로 응답을 구성해야 합니다.

api/src/main/kotlin/com/retoday/api/global/config/SecurityConfiguration.kt

  • 📍 Issue: PERMITTED_AUTH_ENDPOINTS/logout이 포함되지 않은 것은 의도한 대로 토큰 인증이 필요한 엔드포인트로 설정된 것이 맞는지 확인해야 합니다. 로그아웃 API는 Refresh Token 삭제를 위해 사용자 ID가 필요하므로 인증이 요구되는 것이 타당합니다.

core/src/main/kotlin/com/retoday/core/domain/auth/service/AuthService.kt

  • 📍 Issue: logout(userId: Long) 구현 시, Refresh Token이 존재하지 않을 경우 RefreshTokenNotFoundException을 발생시키는 로직은 이미 로그아웃된 사용자가 재시도하는 경우를 적절하게 처리합니다.

Copy link
Member

@1117mg 1117mg left a comment

Choose a reason for hiding this comment

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

LGTM

@earlgrey02 earlgrey02 merged commit 88bb682 into dev Feb 3, 2026
@earlgrey02 earlgrey02 deleted the feature/22-logout branch February 3, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 기능 구현 refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

로그아웃 기능 구현

2 participants