Repository navigation
fix: JWT 인증 버그 수정 및 예외처리 HTTP 상태코드 통일 - #39
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThis PR refactors authentication filter wiring and replaces Spring Security exceptions with domain-specific exceptions. SecurityConfig and JwtAuthenticationFilter are rewired to use dependency injection and UserRepository instead of inline construction with TokenProvider and UserDetailsService. Services now throw NotRoomHostException and NotRoomMemberException instead of AccessDeniedException. Tests are updated to match the new exception types and room-membership checks. ChangesAuthentication Filter Refactoring and Domain Exception Integration
Sequence Diagram(s)sequenceDiagram
participant Client
participant SecurityConfig
participant JwtAuthenticationFilter
participant UserRepository
participant Request
Client->>SecurityConfig: HTTP request with Authorization header
SecurityConfig->>JwtAuthenticationFilter: filter chain delegates
JwtAuthenticationFilter->>JwtAuthenticationFilter: resolve bearer token
JwtAuthenticationFilter->>JwtAuthenticationFilter: validate token → extract email
JwtAuthenticationFilter->>UserRepository: findByEmailAndIsDeactivatedFalse(email)
UserRepository-->>JwtAuthenticationFilter: return User entity
JwtAuthenticationFilter->>JwtAuthenticationFilter: set UsernamePasswordAuthenticationToken
JwtAuthenticationFilter->>Request: continue filter chain
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
[치명적 버그]
SecurityUtils.getCurrentUser()의 instanceof 체크 실패로
JWT 인증 사용자 전원 401 반환되던 문제 수정
→ UserRepository에서 User 엔티티 직접 로드하도록 변경
[HTTP 상태코드 수정]
→ 403 NotRoomMemberException으로 변경
→ NotRoomHostException(ROOM_007, 403)으로 도메인 예외 통일
Summary by CodeRabbit