[Refactor] MEMBER 도메인 리팩토링 - #215
Hidden character warning
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 개요MEMBER 도메인의 종합적인 리팩토링 작업으로, 패스워드 변경 기능을 정리하고 MemberErrorCode를 새로운 패키지로 이동하며, 여러 클래스와 메서드에 문서화 주석을 추가합니다. 변경사항
관련 가능 PR
제안 리뷰어
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/main/java/com/umc/finly/domain/member/enums/PersonaMode.java (1)
3-3: 문서화 주석 추가 좋습니다!Enum의 목적을 명확히 설명하는 주석이 추가되어 코드 가독성이 향상되었습니다.
선택적으로, 클래스 레벨 문서화의 경우 JavaDoc 스타일(
/** ... */)을 사용하면 IDE의 문서 생성 및 툴팁 지원이 더 잘 되지만, 현재의 단순한 주석도 충분히 명확합니다.📝 JavaDoc 스타일 제안 (선택사항)
-// 페르소나 테스트 제출 분기 +/** + * 페르소나 테스트 제출 분기 + */ public enum PersonaMode {src/main/java/com/umc/finly/domain/member/service/MyPageService.java (1)
15-16:newPasswordConfirm파라미터의 위치에 대한 설계 의견.비밀번호 확인(
newPasswordConfirm) 일치 검증은 프레젠테이션 레이어(DTO validation 또는 Controller)에서 처리하는 것이 일반적입니다. 서비스 인터페이스에 확인용 파라미터를 전달하면 서비스 계층이 입력 검증 책임까지 갖게 됩니다.현재 구조로도 동작에는 문제가 없으나, 향후 서비스 메서드 시그니처를
changePassword(Long memberId, String newPassword)로 단순화하고, 비밀번호 일치 검증은 DTO의 커스텀 validator나 컨트롤러에서 처리하는 방안을 고려해 볼 수 있습니다.src/main/java/com/umc/finly/domain/member/service/MyPageServiceImpl.java (1)
82-98: 현재 비밀번호 확인 없이 비밀번호를 변경하고 있습니다.인증된 사용자의 세션/토큰이 탈취된 경우, 기존 비밀번호 확인 없이 비밀번호를 변경할 수 있습니다. 일반적으로 비밀번호 변경 시에는 현재 비밀번호를 함께 받아 검증하는 것이 보안 모범 사례입니다.
의도된 설계라면 무시해도 좋지만, 그렇지 않다면
PasswordChangeReqDTO에currentPassword필드를 추가하고passwordEncoder.matches()로 검증하는 것을 권장합니다.🔒 현재 비밀번호 검증 추가 제안
public void changePassword(Long memberId, String newPassword, String newPasswordConfirm) { + // 참고: currentPassword 파라미터 추가 및 아래 검증 로직 추가 권장 + // if (!passwordEncoder.matches(currentPassword, member.getPassword())) { + // throw new CustomException(AuthErrorCode.INVALID_PASSWORD); + // } + if (newPassword == null || !newPassword.equals(newPasswordConfirm)) { throw new CustomException(AuthErrorCode.PASSWORD_CONFIRM_MISMATCH); }
🔗 관련 이슈
closes #214
📌 작업 내용
🧪 테스트 결과
📸 스크린샷 (선택)
📎 참고 사항 (선택)
Summary by CodeRabbit
릴리스 노트
New Features
Documentation
Refactor