[feat] 로그인/로그아웃 시 hasSession 쿠키 설정/삭제#117
Merged
nYeonG4001 merged 3 commits intodevelopV2from Apr 12, 2026
Merged
Conversation
- 로그인 성공(이메일/소셜/복구) → hasSession=true 쿠키 설정 - 로그아웃 → hasSession 쿠키 삭제(maxAge=0) - httpOnly=false, SameSite=Lax, path=/ — JS에서 읽을 수 있는 세션 힌트 쿠키 - 프론트에서 이 쿠키 유무로 /auth/refresh 호출 여부 판단
- 로그인/소셜 로그인/복구 성공 시 hasSession=true(SameSite=Lax) 쿠키 검증 - 로그아웃 시 refreshToken, hasSession 모두 Max-Age=0 검증 - multiple Set-Cookie 헤더 검증 방식을 람다 + Hamcrest hasItem으로 구현
- "Set-Cookie" 리터럴 상수화(SET_COOKIE_HEADER) — 중복 리터럴 4회 제거 - httpOnly(false) 라인에 NOSONAR java:S2092 주석 추가 — JS 세션 힌트 쿠키 의도적 설계
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
hasSession=true쿠키 Set-CookiehasSession쿠키 삭제(maxAge=0)httpOnly=false,SameSite=Lax,path=/— JS에서 읽을 수 있는 세션 힌트 쿠키AuthInitializer에서 이 쿠키 유무로/auth/refresh호출 여부 판단 가능변경 파일
AuthController.java—HAS_SESSION_COOKIE상수 +setHasSessionCookie/clearHasSessionCookie헬퍼 추가, 5개 엔드포인트에 적용AuthControllerTest.java— 로그인/소셜 로그인/복구/로그아웃 쿠키 검증 케이스 추가Test plan
./gradlew test --tests "com.devpick.domain.user.controller.AuthControllerTest"통과hasSession=true; SameSite=Lax쿠키 포함 검증refreshToken,hasSession모두Max-Age=0검증