fix(oauth): Apple 로그인 시 userName이 null이 되는 문제 수정#286
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 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
🧪 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 |
Summary of ChangesHello @Mindev27, 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! Apple 로그인 과정에서 사용자 이름이 올바르게 설정되지 않던 문제를 해결하기 위한 변경사항입니다. 이메일 정보를 활용하여 닉네임을 생성함으로써, 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. Changelog
Activity
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
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/client/AppleMemberInfoResponse.java`:
- Around line 12-17: getNickName currently returns email.substring(0,
email.indexOf("@")) even when the local-part is empty (e.g., "@domain.com"),
producing an empty nickname; update getNickName to check that email contains "@"
and that email.indexOf("@") > 0 before returning the local-part, otherwise fall
back to returning sub (preserve existing null checks), i.e., validate the
local-part length when locating the "@" in getNickName so you never return an
empty string.
...ank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/client/AppleMemberInfoResponse.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
This PR resolves the issue where userName was null during Apple OAuth login by modifying AppleMemberInfoResponse to extract a nickname from the email's local part, or use the sub claim if the email is unavailable. However, this change introduces a medium-severity Stored Cross-Site Scripting (XSS) vulnerability because the external email input is not sanitized before being used as a nickname, potentially allowing script injection. Furthermore, an edge case exists where the nickname could become an empty string if the email starts with '@'.
fix(oauth): Apple 로그인 시 userName이 null이 되는 문제 수정
Summary by CodeRabbit