From 1ec36f8994c222c76f999a38b03fe808fa094871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=B8=EB=B9=88?= Date: Fri, 31 May 2024 00:00:03 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20cors=20=ED=95=B4=EA=B2=B0=EC=9D=84?= =?UTF-8?q?=20=EC=9C=84=ED=95=9C=20OriginPattern=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java b/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java index b775784e7..6934cb8f1 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java @@ -20,6 +20,7 @@ public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOriginPatterns("https://issue-tracker.site", "http://*:3000") .allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS") + .allowedOriginPatterns("*") .allowedHeaders("*") .allowCredentials(true); } From aa17a62fa4b68df4c31b75cf1f4edf8683f33274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=B8=EB=B9=88?= Date: Fri, 31 May 2024 00:10:24 +0900 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20OriginPattern=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java b/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java index 6934cb8f1..fabd917d4 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java @@ -18,9 +18,8 @@ public class WebConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") - .allowedOriginPatterns("https://issue-tracker.site", "http://*:3000") + .allowedOriginPatterns("https://issue-tracker.site", "http://192.168.1.19:3000") .allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS") - .allowedOriginPatterns("*") .allowedHeaders("*") .allowCredentials(true); } From c3c46257c3d217230bd45c437aa6732d013c51e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=B8=EB=B9=88?= Date: Fri, 31 May 2024 00:38:08 +0900 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/issuetracker/global/interceptor/JwtInterceptor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java b/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java index ee71339ee..fe427523e 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java @@ -19,6 +19,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons throws Exception { String authorization = request.getHeader("Authorization"); String accessToken = jwtUtil.extractJwtToken(authorization); + log.info("accessToken - {}", accessToken); if (accessToken == null) { throw new UnauthorizedException(); From 8e756a84ed38a59524330cc9b501b2048d6209c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=B8=EB=B9=88?= Date: Fri, 31 May 2024 00:51:48 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20@EnableWebMvc=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java b/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java index fabd917d4..f85a149a7 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/WebConfig.java @@ -7,11 +7,13 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration @RequiredArgsConstructor +@EnableWebMvc @Profile("default") // 테스트시 인터셉터 적용 문제로 프로필 적용 public class WebConfig implements WebMvcConfigurer { From e2b8d9f60d2f66d2e1dcd380a22cc24c7eed6e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=B8=EB=B9=88?= Date: Fri, 31 May 2024 00:56:32 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20=EC=82=AD=EC=A0=9C=20=EC=98=88?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/issuetracker/global/interceptor/JwtInterceptor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java b/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java index fe427523e..253e0e8e5 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/global/interceptor/JwtInterceptor.java @@ -19,6 +19,10 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons throws Exception { String authorization = request.getHeader("Authorization"); String accessToken = jwtUtil.extractJwtToken(authorization); + String bearer = request.getHeader("Bearer"); + + log.info("bearer - {}", bearer); + log.info("authorization - {}", authorization); log.info("accessToken - {}", accessToken); if (accessToken == null) {