From ecf3dd23566bec9310d58f6901ffd3fa8c19f6ce Mon Sep 17 00:00:00 2001 From: kimdohyung Date: Thu, 23 Nov 2023 07:43:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20cors=20=EC=9B=90=EB=9E=98=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=EB=A1=9C=20=EB=B3=B5=EA=B5=AC=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/backend/config/SecurityConfig.java | 2 +- .../com/backend/domain/auth/dto/request/JoinRequestDto.java | 2 +- .../java/com/backend/jwt/filter/JwtAuthenticationFilter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/backend/config/SecurityConfig.java b/src/main/java/com/backend/config/SecurityConfig.java index 6e9720a..34452df 100644 --- a/src/main/java/com/backend/config/SecurityConfig.java +++ b/src/main/java/com/backend/config/SecurityConfig.java @@ -85,7 +85,7 @@ public JwtAuthenticationFilter jwtAuthenticationFilter() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") - .allowedOrigins("http://localhost:3000", "https://jedero.site", "https://api.jedero.site") + .allowedOrigins("*") .allowedMethods("*") .allowedHeaders("*") .exposedHeaders("*") diff --git a/src/main/java/com/backend/domain/auth/dto/request/JoinRequestDto.java b/src/main/java/com/backend/domain/auth/dto/request/JoinRequestDto.java index aefbcd5..98865c6 100644 --- a/src/main/java/com/backend/domain/auth/dto/request/JoinRequestDto.java +++ b/src/main/java/com/backend/domain/auth/dto/request/JoinRequestDto.java @@ -7,7 +7,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; public record JoinRequestDto(@NotBlank String password, @NotBlank String email, @NotBlank String type, - @NotBlank String typeName, @NotBlank String proofImageUrl, @NotBlank Long univId) { + @NotBlank String typeName, @NotBlank String proofImageUrl, Long univId) { public User toEntity(PasswordEncoder passwordEncoder, University university) { return User.builder() .email(email) diff --git a/src/main/java/com/backend/jwt/filter/JwtAuthenticationFilter.java b/src/main/java/com/backend/jwt/filter/JwtAuthenticationFilter.java index 3c1d26c..59eec49 100644 --- a/src/main/java/com/backend/jwt/filter/JwtAuthenticationFilter.java +++ b/src/main/java/com/backend/jwt/filter/JwtAuthenticationFilter.java @@ -51,7 +51,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse } } - response.setHeader("Access-Control-Allow-Origin", "https://jedero.site"); + //response.setHeader("Access-Control-Allow-Origin", "https://jedero.site"); filterChain.doFilter(request, response); } } \ No newline at end of file