From 165b67907c1a841387528d2bc5359bfac27a866d Mon Sep 17 00:00:00 2001 From: blackbean Date: Mon, 26 Feb 2024 21:17:05 +0900 Subject: [PATCH] [feat]: refactor Cookie seperate 2 --- .../executionHistory/executionHistory.bin | Bin 11698481 -> 11698481 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .../.gradle/7.6.1/fileHashes/fileHashes.bin | Bin 265419 -> 265419 bytes .../.gradle/7.6.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes server/.gradle/file-system.probe | Bin 8 -> 8 bytes .../api/user/controller/UserController.java | 13 +++++-------- .../recruit/utils/SecurityUtils.java | 4 ++-- 8 files changed, 7 insertions(+), 10 deletions(-) diff --git a/server/.gradle/7.6.1/executionHistory/executionHistory.bin b/server/.gradle/7.6.1/executionHistory/executionHistory.bin index bc892ed89eaf5a1d404d2a1b51fd33a08293c7bf..5be95b5e0f746768e65dc9df6fb2826046bb9a08 100644 GIT binary patch delta 816 zcmXBKeN5DK0LO9ejuQfnA5toc;RT3B7zPAjeyA}As%#d&ug%6a7Rpd^q7_~xNF z6)pUpf`XvpQ39fLgwEvD)_j=SVk_O4Pq`d!;#`YaYQL?|_WtL!&xwjl>JxHhC{Uup z6E&mo!kbs{!I#mD;Z^*Q@MkOmyvFN{V>}ZGWFnIYVlr#!o zmXpQ`(pgCct60q%GWmp0$wJ3k^cXO*4inj|X9GEy*@%T)K4TMB^2n!vLN>F7B0gs; z#gtIW7i_~u8Rb;49jK&=YHIkBuc*b&4tBDOI(D;%ula_0_9AewkNq^z$N>)0L^FqI zp_RiN;V5k!!$~{e@*T%db@UB~<~L-UEx85Oye)dIp=iT8Q+7d2abb2&v{7&J_<~%*PojoA|&4ilc;;%>FY|! zcUs4Y#Z6r$($%cfb6c$HxUfHd%nV)H^Os1yYSW5yI`t@_v_*~;KlPOAT~e8|zPrkO z{Cjst>NLsj3{efFRV4XTKJb2eU$aAKM)tT|QKj8$6yj&Kb^Nl`Dazu>(opa1mDQ7U z!55F*xPG^NaORmXm4{@|o+fVe*%A9OLvN$=(p{O#i`rWQ>=^|^CB4u74liFIQ-bNy zmCnO{mfpa==7EUF9MONdIn8!$e@&xXH@vluor6IydW`b%)a{@@uZ)Cm+x$;P|M`>W z17ynbk}7vSPdVdhHed5Q8>^J*;aY#K$K!|f4u8eX;>?2@nFruK!w-=&H4K>lNcda@!_EJ=&ktY-ro*~Dh7d`=cN>|~RJgD=Qs3wdlMpKTQICEM9SAw}$@m|g6q z1SfkarHpdE!iAf?RPZ&hk4mbjriO3WPb~+i;~@1M;xG*~(!>!2&3wyIT4?1vj&Yn5 zw9(G@ba0YRy7+-^PH~zu^!(`Q8=h%yahBL~ONt!ML`SZ@z-F}N?RGj63i68cjRF5h z@4IWPeWZ6zRv$mP*OJ^TQXOp3vU6H!!8pbH(d)vzcnaWC|&Vk;+LPwvV4-eyXjn| zzvqJAW0@r#abN9BZY?ZXw=zMYwU@_>sL{hdpP}sBdWE>!S*#K6x`P^xDnJU>g_?T? zos$k&&J1L%%AO&9zHuVMrFT4?mt*aCu=sw(_~$W}0eRRrc-}kqSL`KMctqOedmEZ% z>h6CY5;^LLy1irE`3_rqo=ml6S6-T5O#OTR^6S>Rm{Pq=FCL9VrRl=F=3c|}ONNmZ zGI^u_^%zdws_mDa4gIQlv_+;T$CT+e|EQS~dcQGNsTynT64K)&vlwoU)Cv8aF0*K9 zR)&gOzg3%serKlIm->$rb11+18W8r3%yRRBvIRB0yDd@npBjk0bZIDMtUE i->WxkO&5obCdm}%>`9Mnd)Qc^UA?r(qCWI$?)nc`Nn9}i diff --git a/server/.gradle/7.6.1/executionHistory/executionHistory.lock b/server/.gradle/7.6.1/executionHistory/executionHistory.lock index deb77a3c3b0eec857d645d9e10e506247cfa1346..292483817e21fa65f3c65e72d7433afb516c28b6 100644 GIT binary patch literal 17 UcmZSnnEFb{yE#yV0Sp8p0Wfg`@&Et; literal 17 UcmZSnnEFb{yE#yV0Sp9!0WfO=>;M1& diff --git a/server/.gradle/7.6.1/fileHashes/fileHashes.bin b/server/.gradle/7.6.1/fileHashes/fileHashes.bin index 1c97c2acb2705a3ade9637f46d409b1a4f204ed1..a45d054bed9b8988de186e762b24e2d025a6bf43 100644 GIT binary patch delta 126 zcmX>-Q{ePWfrb{w7N#xC>T?txAKV-Q{ePWfrb{w7N#xC>T?v#lmB&;PQEAGX~*1ts5V}Jfq}92sb2dF1~3pVn{MdB zq`Ez44l`$gg#CI$QM1)Ni*_}#q)Zl1ybDtM#9Y8^dM^))luE{d3|8INc@k4jq%C(1 TH2()SNlKUtVv^`8Agu=g+K4B{ diff --git a/server/.gradle/7.6.1/fileHashes/fileHashes.lock b/server/.gradle/7.6.1/fileHashes/fileHashes.lock index 16340213e52945523db97c23aadc9e75a7565bb6..d0c8eea391491f41f3fea09bf8ab7f7499081038 100644 GIT binary patch literal 17 UcmZQh3Jcd*uE#0H00vzT03R9ynE(I) literal 17 UcmZQh3Jcd*uE#0H00v#x03Q$oj{pDw diff --git a/server/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/server/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 69dc40dbbcf706232ddc30b955154007b8cc0e57..95f73ac804d2fa220faa8fddc18eb6bdb23cfbd8 100644 GIT binary patch literal 17 VcmZSnb8WUx;gm=T1~8Bl001|N1VI1* literal 17 VcmZSnb8WUx;gm=T1~8E00suFJ1Umo# diff --git a/server/.gradle/file-system.probe b/server/.gradle/file-system.probe index 0682ab37bae0df6d22f12db9393a0960a5299dc4..deb9a3841e95c91c4a11cc9860d48c32feae03b1 100644 GIT binary patch literal 8 PcmZQzVC;PwB6kA-2y+6y literal 8 PcmZQzVC;P=C0GRj2TcMQ 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 bcfe555c..5e36fb3c 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 @@ -61,14 +61,11 @@ public ResponseEntity login( TokenResponse tokenResponse = userLoginUseCase.execute(loginRequestDto); response.addHeader( "Set-Cookie", - new StringBuilder( - SecurityUtils.setLocalCookie( - "ACCESS_TOKEN", tokenResponse.getAccessToken()) - .toString()) - .append("; ") - .append( - SecurityUtils.setLocalCookie( - "REFRESH_TOKEN", tokenResponse.getRefreshToken())) + SecurityUtils.setLocalCookie("REFRESH_TOKEN", tokenResponse.getRefreshToken()) + .toString()); + response.addHeader( + "Set-Cookie", + SecurityUtils.setLocalCookie("ACCESS_TOKEN", tokenResponse.getAccessToken()) .toString()); return new ResponseEntity<>(tokenResponse, HttpStatus.OK); } 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..af37fd43 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 @@ -5,12 +5,12 @@ public class SecurityUtils { public static ResponseCookie setLocalCookie(String name, String value) { return ResponseCookie.from(name, value) + .path("/") .secure(true) .sameSite("None") .httpOnly(true) .maxAge(2592000) - .path("/") - .domain("localhost") + .domain("127.0.0.1") .build(); }