Skip to content

fix: dev(stage) 환경의 refreshToken 쿠키 이름 분리#715

Open
sukangpunch wants to merge 2 commits intodevelopfrom
fix/711-separate-dev-refresh-token-cookie-name
Open

fix: dev(stage) 환경의 refreshToken 쿠키 이름 분리#715
sukangpunch wants to merge 2 commits intodevelopfrom
fix/711-separate-dev-refresh-token-cookie-name

Conversation

@sukangpunch
Copy link
Copy Markdown
Contributor

관련 이슈

작업 내용

prod 와 stage 의 refreshToken 키 네임이 동일하여 발생하는 로그인 문제를 해결하기 위해 stage 서버의 key name을 stageRefreshToken 으로 수정하였습니다.

  1. prod 브라우저의 refresthToken 이 stage 브라우저 에서도 유효
  2. 프론트 미들웨어에서 refreshToken 을 관리 할 때, prod와 stage 둘다 key name이 동일하여 덮어 씌워지는 문제 발생.

특이 사항

리뷰 요구사항 (선택)

- prod와 stage가 동일한 쿠키 도메인을 공유하여 발생하는 로그인 충돌 문제 해결
- 쿠키 이름을 환경별로 분리할 수 있도록 cookie-name 설정 추가
@sukangpunch sukangpunch self-assigned this May 5, 2026
@sukangpunch sukangpunch added the 버그 Something isn't working label May 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 05e350a4-7a70-4489-b997-331dad89c951

📥 Commits

Reviewing files that changed from the base of the PR and between b489fd3 and f482db0.

📒 Files selected for processing (1)
  • src/main/resources/config/application-variable.yml
✅ Files skipped from review due to trivial changes (1)
  • src/main/resources/config/application-variable.yml

Walkthrough

  1. RefreshTokenCookieProperties에 cookieName 필드를 추가했습니다.
  2. application-variable.yml의 prod/dev/local 프로필에 token.refresh.cookie-name을 각각 추가했습니다.
  3. RefreshTokenCookieManager에서 하드코딩된 쿠키 이름을 제거하고 properties.cookieName()으로 쿠키 생성 및 조회하도록 변경했습니다.
  4. 테스트의 setUp()에서 refreshTokenCookieProperties.cookieName()을 스텁하도록 업데이트했습니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • wibaek
  • lsy1307
  • Gyuhyeok99
  • Hexeong

상세 변경 내용

  1. RefreshTokenCookieManager.java — 쿠키 이름을 설정으로 외부화

    • 기존의 고정된 COOKIE_NAME 상수를 제거했습니다.
    • ResponseCookie 생성에 properties.cookieName()을 사용하도록 변경했습니다.
    • 요청 쿠키 조회 시 properties.cookieName().equals(cookie.getName())로 필터합니다.
  2. RefreshTokenCookieProperties.java — 설정 레코드에 필드 추가

    • 레코드 파라미터에 cookieName 필드를 추가했습니다.
  3. application-variable.yml — 프로필별 쿠키 이름 설정

    • prod: token.refresh.cookie-name: "refreshToken"
    • dev: token.refresh.cookie-name: "stageRefreshToken"
    • local: token.refresh.cookie-name: "refreshToken"
  4. RefreshTokenCookieManagerTest.java — 테스트 셋업 갱신

    • setUp()에서 refreshTokenCookieProperties.cookieName()을 스텁하도록 추가했습니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확하게 요약하고 있습니다. 'stage 환경의 refreshToken 쿠키 이름 분리'는 이 PR의 주요 목표를 정확히 반영합니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 있으며, 관련 이슈, 작업 내용, 문제 상황을 명확하게 기술하고 있습니다.
Linked Issues check ✅ Passed 모든 코드 변경사항이 #711의 요구사항을 충족합니다. RefreshTokenCookieProperties에 configurable cookieName 필드 추가, RefreshTokenCookieManager에서 동적 쿠키 이름 사용, application-variable.yml에서 환경별 쿠키 이름 설정(prod: 'refreshToken', dev: 'stageRefreshToken')이 모두 구현되어 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #711의 refreshToken 쿠키 이름 분리라는 목표에 직접적으로 관련되어 있으며, 범위를 벗어난 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/711-separate-dev-refresh-token-cookie-name

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@sukangpunch sukangpunch added the 최종 리뷰 최소 1명 필수 label May 5, 2026
Copy link
Copy Markdown
Member

@whqtker whqtker left a comment

Choose a reason for hiding this comment

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

확인했습니다 !


token:
refresh:
cookie-name: "refreshToken"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

prod도 명시적으로 prodRefreshToken을 사용하도록 하면 어떨까요 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

넵 알겠습니다!


token:
refresh:
cookie-name: "refreshToken"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

로컬은 그냥 둬도 될 듯 합니다 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 Something isn't working 최종 리뷰 최소 1명 필수

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: prod refresh 토큰 stage refresh 토큰 키 네이밍 분리

2 participants