Skip to content

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

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

fix: dev(stage) 환경의 refreshToken 쿠키 이름 분리#715
sukangpunch wants to merge 1 commit 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

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: f3a4bd9e-aabb-4a36-8607-9e72a204ade8

📥 Commits

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

📒 Files selected for processing (4)
  • src/main/java/com/example/solidconnection/auth/controller/RefreshTokenCookieManager.java
  • src/main/java/com/example/solidconnection/auth/controller/config/RefreshTokenCookieProperties.java
  • src/main/resources/config/application-variable.yml
  • src/test/java/com/example/solidconnection/auth/controller/RefreshTokenCookieManagerTest.java

Walkthrough

이 변경은 리프레시 토큰 쿠키의 이름을 하드코딩된 값에서 설정 가능한 값으로 전환합니다. RefreshTokenCookieManager의 고정된 쿠키 이름("refreshToken")을 제거하고, RefreshTokenCookiePropertiescookieName 필드를 추가한 후 이를 통해 쿠키를 생성하고 읽습니다. 프로필별 설정 파일(application-variable.yml)에서 각각 prod, dev, local 환경에 대응하는 쿠키 이름을 정의하고, 테스트 코드도 이 설정값을 스텁하도록 갱신했습니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • wibaek
  • lsy1307
  • whqtker
  • Gyuhyeok99

상세 변경 내용

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

  • 기존의 고정된 COOKIE_NAME 상수 제거
  • 쿠키 생성 시 ResponseCookie.from(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의 주요 변경 사항을 명확하게 반영하고 있습니다. 'dev(stage) 환경의 refreshToken 쿠키 이름 분리'라는 표현은 무엇을 했는지 정확히 전달합니다.
Description check ✅ Passed PR 설명이 관련 이슈, 작업 내용을 포함하고 있습니다. 문제 상황과 해결 방안이 명확하게 기술되어 있어 템플릿의 핵심 요소를 충족합니다.
Linked Issues check ✅ Passed PR의 코드 변경 사항이 이슈 #711의 목표와 일치합니다. 환경별 쿠키 이름 분리를 위해 RefreshTokenCookieProperties에 cookieName 필드를 추가하고 설정 파일에서 환경별 값을 구성했습니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/711-separate-dev-refresh-token-cookie-name

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
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 토큰 키 네이밍 분리

1 participant