Skip to content

Commit 4bea4d2

Browse files
committed
fix: 쿠키 크로스 도메인 공유하도록 설정 변경
1 parent 8773b14 commit 4bea4d2

File tree

5 files changed

+6
-205
lines changed

5 files changed

+6
-205
lines changed

src/main/java/com/back/global/rq/Rq.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class Rq {
3131
@Value("${custom.cookie.same}")
3232
private String cookieSameSite;
3333

34+
@Value("${custom.site.cookieDomain}")
35+
private String cookieDomain;
36+
3437

3538
public User getActor() {
3639
return Optional.ofNullable(
@@ -95,6 +98,7 @@ public void setCrossDomainCookie(String name, String value, int maxAge) {
9598
.maxAge(maxAge)
9699
.secure(cookieSecure)
97100
.sameSite(cookieSameSite)
101+
.domain(cookieDomain)
98102
.httpOnly(true)
99103
.build();
100104
resp.addHeader("Set-Cookie", cookie.toString());

src/main/resources/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ logging:
5858
# 쿠키 보안 설정 (HTTP 환경용)
5959
custom:
6060
cookie:
61-
secure: true
61+
secure: false
6262
same: "Lax"
6363

6464
# # AI 설정

src/main/resources/application-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ custom:
4444
cookie:
4545
secure: true
4646
same: "None"
47-
domain: ${custom.prod.cookieDomain}
4847
site:
48+
cookieDomain: ".${BASE_URL}"
4949
frontUrl: "${custom.prod.frontUrl}"
5050
backUrl: "${custom.prod.backUrl}"
5151
name: ssoul

src/test/java/com/back/global/security/CustomAuthenticationFilterTest.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/test/java/com/back/global/security/CustomOAuth2LoginSuccessHandlerTest.java

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)