From 6c638a270d8af0fcb339b06231d53f40c89f7775 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Mon, 26 Feb 2024 16:39:26 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20cookie=20domain=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruit/api/user/controller/UserController.java | 9 +++++---- .../com/econovation/recruit/utils/SecurityUtils.java | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/controller/UserController.java b/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/controller/UserController.java index 3a0e7715..5fc59f31 100644 --- a/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/controller/UserController.java +++ b/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/controller/UserController.java @@ -70,11 +70,12 @@ public ResponseEntity login( SecurityUtils.setLocalCookie( "REFRESH_TOKEN", tokenResponse.getRefreshToken())) .toString()); - response.addHeader("Set-Cookie", + response.addHeader( + "Set-Cookie", new StringBuilder( - SecurityUtils.setProdCookie( - "ACCESS_TOKEN", tokenResponse.getAccessToken()) - .toString()) + SecurityUtils.setProdCookie( + "ACCESS_TOKEN", tokenResponse.getAccessToken()) + .toString()) .append("; ") .append( SecurityUtils.setProdCookie( diff --git a/server/Recruit-Api/src/main/java/com/econovation/recruit/utils/SecurityUtils.java b/server/Recruit-Api/src/main/java/com/econovation/recruit/utils/SecurityUtils.java index bc85279d..7f72af81 100644 --- a/server/Recruit-Api/src/main/java/com/econovation/recruit/utils/SecurityUtils.java +++ b/server/Recruit-Api/src/main/java/com/econovation/recruit/utils/SecurityUtils.java @@ -10,7 +10,7 @@ public static ResponseCookie setLocalCookie(String name, String value) { .httpOnly(true) .maxAge(2592000) .path("/") - .domain("localhost") + .domain("http://localhost") .build(); } @@ -21,7 +21,7 @@ public static ResponseCookie setProdCookie(String name, String value) { .httpOnly(true) .maxAge(2592000) .path("/") - .domain("recruit.econovation.kr") + .domain("https://recruit.econovation.kr") .build(); } }