Skip to content

fix: remove social login queryString - #39

Merged
SungHuii merged 2 commits into
developfrom
feature/user-find-frontend
Jul 23, 2026
Merged

SungHuii merged 2 commits into
developfrom
feature/user-find-frontend

Conversation

@jaejo

@jaejo jaejo commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

작업 내용

  • 기존에 AccessToken이 쿼리스트링으로 인해 URL에 포함되는 문제 -> 보안 문제
  • => 쿼리 스트링을 제거하고 순수 쿠키 방식으로 해결
  • 에러 발생 시 더미 객체로 로그인 되는 문제 삭제

변경 사항

체크리스트

  • 테스트 코드 작성 완료
  • 리뷰어 지정 완료

참고 사항

관련 이슈

Summary by CodeRabbit

  • 새로운 기능

    • 소셜 로그인 후 액세스 토큰을 URL에 노출하지 않고 쿠키 기반 인증으로 처리합니다.
    • 로그인 완료 후 안전한 리다이렉트와 세션 복원이 지원됩니다.
  • 버그 수정

    • OAuth 로그인 및 콜백 경로 처리를 개선했습니다.
    • 페이지 새로고침이나 재방문 시 인증 상태를 안정적으로 확인합니다.
    • 로그인 과정에서 불필요한 오류 안내와 임시 로그인 처리를 제거했습니다.

@jaejo
jaejo requested review from SungHuii and idktomorrow July 23, 2026 05:34
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jaejo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3eafb829-3249-42b8-bc5b-a590a0f84b83

📥 Commits

Reviewing files that changed from the base of the PR and between 24afb6b and cb1782e.

📒 Files selected for processing (1)
  • momogo-api/src/main/java/com/momogo/api/auth/handler/OAuth2LoginSuccessHandler.java
📝 Walkthrough

Walkthrough

OAuth 로그인 성공 시 토큰을 URL에 포함하지 않고 직접 리다이렉트하며, 프론트엔드는 HttpOnly Refresh Cookie로 세션을 확인합니다. 소셜 로그인은 OAuth 경로로 즉시 이동하고, Vite 프록시 경로가 구체화되었습니다.

Changes

OAuth 쿠키 인증 흐름

Layer / File(s) Summary
OAuth 성공 리다이렉트 변경
momogo-api/.../OAuth2LoginSuccessHandler.java
소셜 로그인 성공 시 accessToken 쿼리 파라미터를 제거하고 redirectUrl로 직접 리다이렉트합니다.
프론트엔드 쿠키 세션 확인
momogo-frontend/src/App.tsx, momogo-frontend/src/pages/LoginPage.tsx
소셜 로그인 버튼은 OAuth 경로로 즉시 이동하며, 세션 확인은 URL 토큰 대신 Refresh Cookie 기반으로 동작합니다.
OAuth 프록시 경로 구체화
momogo-frontend/vite.config.ts
/oauth2/authorization/login/oauth2/code를 백엔드로 전달하도록 프록시 키를 변경했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant LoginPage
  participant OAuthProvider
  participant OAuth2LoginSuccessHandler
  participant App
  User->>LoginPage: 소셜 로그인 선택
  LoginPage->>OAuthProvider: OAuth 인증 시작
  OAuthProvider->>OAuth2LoginSuccessHandler: 인증 콜백
  OAuth2LoginSuccessHandler->>App: 토큰 없는 redirectUrl 리다이렉트
  App->>App: Refresh Cookie로 /api/auth/refresh 호출
  App->>App: /api/users/me 호출
Loading

Possibly related PRs

  • MoMoGo-QuizPlatform/MoMoGo#15: OAuth 성공 시 토큰 쿼리 파라미터를 제거하고 redirectUrl로 직접 이동하는 변경과 직접 연결됩니다.

Suggested reviewers: idktomorrow, sunghuii

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 소셜 로그인에서 URL 쿼리스트링으로 토큰을 보내지 않도록 바꾸는 핵심 변경을 잘 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/user-find-frontend

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@momogo-api/src/main/java/com/momogo/api/auth/handler/OAuth2LoginSuccessHandler.java`:
- Around line 71-72: OAuth2LoginSuccessHandler의 Javadoc에서 더 이상 사용하지 않는 token 쿼리
파라미터 전달 설명을 제거하세요. Access Token을 URL에 포함하지 않고 Refresh Cookie 발급 후 프론트엔드로 리다이렉트하는
현재 동작을 설명하도록 해당 문서를 갱신하고, 구현부의 response.sendRedirect 흐름은 변경하지 마세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 293b939d-8fad-4fec-abb7-e2d33e5c54de

📥 Commits

Reviewing files that changed from the base of the PR and between 84b388f and 24afb6b.

📒 Files selected for processing (4)
  • momogo-api/src/main/java/com/momogo/api/auth/handler/OAuth2LoginSuccessHandler.java
  • momogo-frontend/src/App.tsx
  • momogo-frontend/src/pages/LoginPage.tsx
  • momogo-frontend/vite.config.ts

@idktomorrow idktomorrow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수정하시느라 고생하셨습니다! 👍

@SungHuii SungHuii left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@SungHuii
SungHuii merged commit c034116 into develop Jul 23, 2026
2 checks passed
@jaejo
jaejo deleted the feature/user-find-frontend branch July 31, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants