refactor(auth): 일관되게 변경. if 절에서 throw 하도록 하여 가독성 향상#279
Conversation
📝 WalkthroughWalkthroughThe password validation in the login service was reordered to check for password mismatch first (updates failure counts, persists member, throws exception); on match the member is unlocked and JWT login is generated. (Reordered control flow, no public API changes.) Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
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 |
Summary of ChangesHello @huhdy32, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 풀 리퀘스트는 코드 가독성과 유지보수성을 높이기 위해 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java (2)
48-50: Remove duplicate comment.Lines 48 and 50 contain identical comments ("// 비밀번호 불일치"). The comment on line 48 is sufficient; the one on line 50 should be removed.
♻️ Proposed fix
// 비밀번호 불일치 if (!isMatch(command.password(), member.getPassword())) { - // 비밀번호 불일치 member.getLockInfo().addFailedCount(now); memberRepository.save(member);
58-58: Consider explicit save for consistency.On line 52, the member is explicitly saved after updating the failed count. Here, the unlock relies on JPA auto-flush at transaction commit. While functionally correct, consider explicitly saving the member after unlocking for consistency and clarity.
♻️ Proposed fix
member.getLockInfo().unlock(); + memberRepository.save(member); log.info("[LoginService.login] member login success: {}", member.getId()); return jwtLoginManager.login(member.getId(), member.getRole(), member.getName());
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.