From fc8f6341c0d2add0d6bc73ee3734345d5a41018e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EA=B5=90=ED=9C=98?= Date: Tue, 11 Jun 2024 16:57:18 +0900 Subject: [PATCH] =?UTF-8?q?uri=20=EC=88=98=EC=A0=95=20:=20=ED=94=84?= =?UTF-8?q?=EB=A1=A0=ED=8A=B8=20=EB=B0=B0=ED=8F=AC=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/soongsil/CoffeeChat/config/CorsMvcConfig.java | 2 +- .../java/com/soongsil/CoffeeChat/config/SecurityConfig.java | 3 ++- .../CoffeeChat/config/oauth2/CustomSuccessHandler.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/soongsil/CoffeeChat/config/CorsMvcConfig.java b/src/main/java/com/soongsil/CoffeeChat/config/CorsMvcConfig.java index 0a3bb5f..d6e87ef 100644 --- a/src/main/java/com/soongsil/CoffeeChat/config/CorsMvcConfig.java +++ b/src/main/java/com/soongsil/CoffeeChat/config/CorsMvcConfig.java @@ -16,7 +16,7 @@ public void addCorsMappings(CorsRegistry corsRegistry) { corsRegistry.addMapping("/**") //모든 경로에서 매핑 진행 .exposedHeaders("Set-Cookie") //노출할 헤더값은 쿠키헤더 - .allowedOrigins("https://localhost:3000", "https://cogo.life") + .allowedOrigins("https://localhost:3000", "https://cogo.life", "https://coffeego-ssu.web.app") .allowedMethods("OPTIONS", "GET", "POST", "PUT", "DELETE") .allowedHeaders("*") .allowCredentials(true) diff --git a/src/main/java/com/soongsil/CoffeeChat/config/SecurityConfig.java b/src/main/java/com/soongsil/CoffeeChat/config/SecurityConfig.java index 1ff6a04..4b2c88d 100644 --- a/src/main/java/com/soongsil/CoffeeChat/config/SecurityConfig.java +++ b/src/main/java/com/soongsil/CoffeeChat/config/SecurityConfig.java @@ -87,7 +87,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http .cors(corsCustomizer -> corsCustomizer.configurationSource(request -> { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(Arrays.asList("https://localhost:3000", "http://localhost:8080", "https://cogo.life")); // 프론트 서버의 주소들 // 프론트 서버의 주소 + configuration.setAllowedOrigins(Arrays.asList("https://localhost:3000", "http://localhost:8080", "https://cogo.life", + "https://coffeego-ssu.web.app")); // 프론트 서버의 주소들 // 프론트 서버의 주소 configuration.setAllowedMethods(Collections.singletonList("*")); // 모든 요청 메서드 허용 configuration.setAllowCredentials(true); configuration.setAllowedHeaders(Collections.singletonList("*")); // 모든 헤더 허용 diff --git a/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java b/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java index f69c9c8..f2008b0 100644 --- a/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java +++ b/src/main/java/com/soongsil/CoffeeChat/config/oauth2/CustomSuccessHandler.java @@ -86,8 +86,8 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo } response.setStatus(HttpStatus.OK.value()); - //response.sendRedirect("https://cogo.life/swagger-ui/index.html"); - response.sendRedirect("https://localhost:3000/callback"); + //response.sendRedirect("https://localhost:3000/callback"); + response.sendRedirect("https://coffeego-ssu.web.app/callback"); } private void addSameSiteCookie(HttpServletResponse response, String name, String value) {