Skip to content

[HOTFIX] 리다이랙트 url 변경 - #177

Merged
on1yoneprivate merged 2 commits into
developfrom
hotfix/#176-client-url
Aug 9, 2026
Merged

[HOTFIX] 리다이랙트 url 변경#177
on1yoneprivate merged 2 commits into
developfrom
hotfix/#176-client-url

Conversation

@kimyw1018

@kimyw1018 kimyw1018 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

📍 개요

리다이랙트 url 변경

⛓️‍💥 관련 이슈


🛠️ 작업 내용

  • 리다이랙트 url 변경

✅ 체크리스트

  • 코드 컨벤션을 준수했습니다.
  • 불필요한 코드 및 import를 제거했습니다.
  • 예외 처리를 적용했습니다.
  • 테스트를 완료했습니다.
  • 관련 Issue를 연결했습니다.

📎 참고 사항

Summary by CodeRabbit

  • 새 기능

    • 환경변수로 CORS 허용 출처를 설정할 수 있습니다.
    • OAuth 프런트엔드 리다이렉트 URI를 환경변수로 지정할 수 있습니다.
    • 운영 환경의 리다이렉트 도메인 지원이 추가되었습니다.
  • 개선

    • OAuth 리다이렉트 URL이 사용자 설정, 기본값, 허용 목록 순으로 안정적으로 선택됩니다.
    • 설정된 URL의 불필요한 공백을 자동으로 제거합니다.

@kimyw1018 kimyw1018 self-assigned this Aug 9, 2026
@kimyw1018 kimyw1018 added bug Something isn't working 🐛bugfix labels Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 51 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: d473e5a9-e150-450b-b8fc-f007d303a9ec

📥 Commits

Reviewing files that changed from the base of the PR and between deb0fed and 2f92f5a.

📒 Files selected for processing (3)
  • MR_config/local/application.example.yml
  • src/main/java/com/mr/global/security/SecurityConfig.java
  • src/main/resources/application.yml
📝 Walkthrough

Walkthrough

CORS 허용 origin과 OAuth 운영 리다이렉트 URI를 환경 변수 및 허용 목록에 반영했다. OAuth 서비스는 사용자 지정 URL, 설정값, 허용 목록, localhost 순서로 기준 URL을 선택한다.

Changes

OAuth 및 웹 출처 설정

Layer / File(s) Summary
CORS 및 OAuth 환경 설정
MR_config/local/application.example.yml, src/main/resources/application.yml
CORS 허용 origin을 환경 변수로 설정한다. 프런트엔드 기본 리다이렉트 URI를 환경 변수로 설정한다. 허용 목록에 musereview.site 운영 주소를 추가하고 기존 Vercel 주소를 제거한다.
OAuth 리다이렉트 URL 선택
src/main/java/com/mr/domain/auth/service/OAuthClientService.java
사용자 지정 허용 URL, 설정된 기본 URL, 허용 목록의 첫 번째 URL, localhost 기본값 순서로 기준 URL을 선택한다. 코드 및 오류 리다이렉트가 공통 선택 메서드를 사용한다.

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

Possibly related PRs

  • Musereview/BE#67: OAuth 프런트엔드 리다이렉트 처리와 관련된 기존 흐름을 추가했다.
  • Musereview/BE#103: OAuth 리다이렉트 URI 설정과 선택 로직을 도입했다.
  • Musereview/BE#106: OAuthClientService와 OAuth 리다이렉트 설정을 함께 수정했다.

Poem

환경 변수가 길을 열고
허용 목록이 방향을 잡네
코드와 오류도 같은 길로
운영 도메인에 도착하니
OAuth 콜백이 반짝인다 ✨

🚥 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 변경이라는 주요 변경 사항을 명확하게 설명합니다.
Linked Issues check ✅ Passed 설정과 OAuth 선택 로직이 변경된 클라이언트 URL 등록 목표를 충족합니다 [#176].
Out of Scope Changes check ✅ Passed CORS 설정과 OAuth 리다이렉트 로직 변경은 변경된 클라이언트 URL 적용에 직접 관련됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/#176-client-url

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: 2

🧹 Nitpick comments (2)
src/main/java/com/mr/domain/auth/service/OAuthClientService.java (1)

321-332: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

리다이렉트 선택 순서를 단위 테스트로 고정하세요.

resolveFrontendRedirectBaseUrl는 사용자 지정 URI, frontendRedirectUri, 허용 목록 첫 항목, localhost 순서로 동작합니다. OAuthClientServiceTest에 다음 경우를 추가하세요.

  • 허용된 사용자 지정 URI의 trim
  • 거부된 사용자 지정 URI의 fallback
  • 설정 URI가 없는 경우의 fallback
  • 성공 및 오류 리다이렉트가 같은 기준 URL을 사용하는지 여부

buildFrontendRedirectUrlbuildFrontendErrorRedirectUrl를 통해 테스트하면 private 메서드에 결합되지 않습니다.

🤖 Prompt for 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.

In `@src/main/java/com/mr/domain/auth/service/OAuthClientService.java` around
lines 321 - 332, OAuthClientServiceTest에 buildFrontendRedirectUrl 및
buildFrontendErrorRedirectUrl를 사용한 단위 테스트를 추가해 resolveFrontendRedirectBaseUrl의
선택 순서를 고정하세요: 허용된 사용자 지정 URI는 trim하고, 거부된 URI는 설정 URI로 fallback하며, 설정 URI가 없으면
허용 목록 첫 항목과 localhost 순서로 fallback하고, 성공·오류 리다이렉트가 동일한 기준 URL을 사용하는지 검증하세요.
src/main/resources/application.yml (1)

50-54: 🗄️ Data Integrity & Integration | 🔵 Trivial

배포 환경 변수와 CORS fallback을 함께 갱신하세요.

YAML의 CORS_ALLOWED_ORIGINSOAUTH_FRONTEND_REDIRECT_URI 기본값은 해당 환경 변수가 없을 때만 사용됩니다. 배포 환경에 기존 값이 있으면 새 운영 도메인이 반영되지 않습니다.

또한 SecurityConfig의 별도 fallback에는 https://musereview-sigma.vercel.app이 남아 있고 새 운영 origin은 없습니다. OAuthProperties는 환경 변수의 OAUTH_FRONTEND_REDIRECT_URI도 허용 목록에 추가하므로, 오래된 환경 변수가 남으면 이전 URI가 계속 유효합니다.

배포 변수와 SecurityConfig fallback의 실제 값을 갱신하고, Spring Boot 외부 설정 우선순위에 따라 유효한 설정을 확인하세요.

🤖 Prompt for 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.

In `@src/main/resources/application.yml` around lines 50 - 54, 배포 환경 변수의
CORS_ALLOWED_ORIGINS와 OAUTH_FRONTEND_REDIRECT_URI 값을 새 운영 도메인 기준으로 갱신하고,
application.yml의 fallback도 동일하게 맞추세요. SecurityConfig의 별도 CORS fallback에서 기존
Vercel origin을 제거하고 새 운영 origin을 추가하며, OAuthProperties의 허용 목록에는 환경 변수로 지정된
OAUTH_FRONTEND_REDIRECT_URI도 반영되도록 확인하세요. Spring Boot 외부 설정이 application.yml
fallback보다 우선하므로 실제 배포 변수에도 변경된 값이 적용되는지 검증하세요.
🤖 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 `@src/main/resources/application.yml`:
- Line 50: application.yml의 allowed-origins fallback을 SecurityConfig의 최신 허용
origin 목록과 동일하게 갱신하세요. 설정 파일을 읽지 못하는 경우에도 새 운영 origin은 허용되고 제거된 이전 Vercel
origin은 거부되도록 두 설정의 허용 목록을 동기화하세요.
- Around line 50-58: Align CORS origins with the OAuth frontend redirect URI
allowlist in src/main/resources/application.yml lines 50-58 and
MR_config/local/application.example.yml lines 50-58: because localhost:3000 is
currently allowed by CORS, add its /oauth/callback URI to
oauth.frontend-redirect-uris in both files, or remove localhost:3000 from
allowed-origins if that port is unsupported.

---

Nitpick comments:
In `@src/main/java/com/mr/domain/auth/service/OAuthClientService.java`:
- Around line 321-332: OAuthClientServiceTest에 buildFrontendRedirectUrl 및
buildFrontendErrorRedirectUrl를 사용한 단위 테스트를 추가해 resolveFrontendRedirectBaseUrl의
선택 순서를 고정하세요: 허용된 사용자 지정 URI는 trim하고, 거부된 URI는 설정 URI로 fallback하며, 설정 URI가 없으면
허용 목록 첫 항목과 localhost 순서로 fallback하고, 성공·오류 리다이렉트가 동일한 기준 URL을 사용하는지 검증하세요.

In `@src/main/resources/application.yml`:
- Around line 50-54: 배포 환경 변수의 CORS_ALLOWED_ORIGINS와 OAUTH_FRONTEND_REDIRECT_URI
값을 새 운영 도메인 기준으로 갱신하고, application.yml의 fallback도 동일하게 맞추세요. SecurityConfig의 별도
CORS fallback에서 기존 Vercel origin을 제거하고 새 운영 origin을 추가하며, OAuthProperties의 허용
목록에는 환경 변수로 지정된 OAUTH_FRONTEND_REDIRECT_URI도 반영되도록 확인하세요. Spring Boot 외부 설정이
application.yml fallback보다 우선하므로 실제 배포 변수에도 변경된 값이 적용되는지 검증하세요.
🪄 Autofix

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: b91ccf7e-a5ec-4630-a3ae-93f9658ba70d

📥 Commits

Reviewing files that changed from the base of the PR and between 8b87c56 and deb0fed.

📒 Files selected for processing (3)
  • MR_config/local/application.example.yml
  • src/main/java/com/mr/domain/auth/service/OAuthClientService.java
  • src/main/resources/application.yml

Comment thread src/main/resources/application.yml Outdated
Comment thread src/main/resources/application.yml Outdated

@on1yoneprivate on1yoneprivate left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

변경 사항 확인했습니다! 수고하셨어요

@rkdehdrbs7885-oss rkdehdrbs7885-oss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수고하셨습니다!

@on1yoneprivate
on1yoneprivate merged commit 4d799f1 into develop Aug 9, 2026
2 checks passed
@kimyw1018
kimyw1018 deleted the hotfix/#176-client-url branch August 9, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 🐛bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 BugFix - 클라이언트 url 등록

3 participants