diff --git a/src/main/java/WELLET/welletServer/config/CorsMvcConfig.java b/src/main/java/WELLET/welletServer/config/CorsMvcConfig.java index ab438fc..2e19d9b 100644 --- a/src/main/java/WELLET/welletServer/config/CorsMvcConfig.java +++ b/src/main/java/WELLET/welletServer/config/CorsMvcConfig.java @@ -14,10 +14,10 @@ public class CorsMvcConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry corsRegistry) { - corsRegistry.addMapping("/**") - .exposedHeaders("Set-Cookie") - .allowedOrigins("http://localhost:8000", frontendUrl) - .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 허용할 HTTP method - .allowCredentials(true); // 쿠키 인증 요청 허용 +// corsRegistry.addMapping("/**") +// .exposedHeaders("Set-Cookie") +// .allowedOrigins("http://localhost:8000", frontendUrl) +// .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 허용할 HTTP method +// .allowCredentials(true); // 쿠키 인증 요청 허용 } } diff --git a/src/main/java/WELLET/welletServer/kakaologin/controller/KakaoLoginController.java b/src/main/java/WELLET/welletServer/kakaologin/controller/KakaoLoginController.java index 354f6c2..fb06a42 100644 --- a/src/main/java/WELLET/welletServer/kakaologin/controller/KakaoLoginController.java +++ b/src/main/java/WELLET/welletServer/kakaologin/controller/KakaoLoginController.java @@ -99,12 +99,12 @@ public String callback(@RequestParam("code") String code, HttpServletResponse re // jwtCookie.setPath("/"); // 쿠키를 모든 경로에 적용 // jwtCookie.setDomain("wellet"); - Cookie jwtCookie = new Cookie("jwtToken", jwtToken); - jwtCookie.setHttpOnly(true); - jwtCookie.setSecure(true); // HTTPS에서만 전송 - jwtCookie.setMaxAge(60 * 60 * 24); // 쿠키 유효 시간 설정 - jwtCookie.setPath("/"); - response.addCookie(jwtCookie); +// Cookie jwtCookie = new Cookie("jwtToken", jwtToken); +// jwtCookie.setHttpOnly(true); +// jwtCookie.setSecure(true); // HTTPS에서만 전송 +// jwtCookie.setMaxAge(60 * 60 * 24); // 쿠키 유효 시간 설정 +// jwtCookie.setPath("/"); +// response.addCookie(jwtCookie); response.addHeader("Set-Cookie", "jwtToken=" + jwtToken + "; Path=/; HttpOnly; Secure; Max-Age=" + (60 * 60 * 24) + "; SameSite=None"); @@ -123,7 +123,7 @@ public String callback(@RequestParam("code") String code, HttpServletResponse re // jwtCookie.setDomain(frontendUrl); - response.addCookie(jwtCookie); +// response.addCookie(jwtCookie); // ResponseCookie jwtCookie = ResponseCookie.from("jwtToken", jwtToken) // .httpOnly(true)