diff --git a/src/main/java/me/pinitnotification/infrastructure/authenticate/config/CorsProperties.java b/src/main/java/me/pinitnotification/infrastructure/authenticate/config/CorsProperties.java deleted file mode 100644 index 4461b68..0000000 --- a/src/main/java/me/pinitnotification/infrastructure/authenticate/config/CorsProperties.java +++ /dev/null @@ -1,21 +0,0 @@ -package me.pinitnotification.infrastructure.authenticate.config; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import java.util.List; - -@Getter -@Setter -@Component -@ConfigurationProperties(prefix = "cors") -public class CorsProperties { - - private List allowedOrigins; - private List allowedMethods; - private List allowedHeaders; - private Boolean allowCredentials; - private Long maxAge; -} diff --git a/src/main/java/me/pinitnotification/infrastructure/authenticate/config/SecurityConfig.java b/src/main/java/me/pinitnotification/infrastructure/authenticate/config/SecurityConfig.java index 9633fbf..0102ee8 100644 --- a/src/main/java/me/pinitnotification/infrastructure/authenticate/config/SecurityConfig.java +++ b/src/main/java/me/pinitnotification/infrastructure/authenticate/config/SecurityConfig.java @@ -16,9 +16,6 @@ import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.CorsConfigurationSource; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import java.security.PublicKey; @@ -70,18 +67,4 @@ public JwtTokenProvider jwtTokenProvider() { PublicKey publicKey = RsaKeyProvider.loadPublicKey(publicKeyPath); return new JwtTokenProvider(publicKey); } - - @Bean - public CorsConfigurationSource corsConfigurationSource(CorsProperties corsProperties) { - CorsConfiguration config = new CorsConfiguration(); - config.setAllowedOrigins(corsProperties.getAllowedOrigins()); - config.setAllowedMethods(corsProperties.getAllowedMethods()); - config.setAllowedHeaders(corsProperties.getAllowedHeaders()); - config.setAllowCredentials(corsProperties.getAllowCredentials()); - config.setMaxAge(corsProperties.getMaxAge()); - - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/**", config); - return source; - } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5fca049..89b2ae3 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -5,21 +5,3 @@ vapid: public: BF8QQIULasLr94n0l0xbv43yZeNICudM5lpQN08VYn2g5VjBPU0wM98HypyRmEb-y0ARRsiZ_wcgSMIC-nq-x20 private: ${VAPID_PRIVATE_KEY} - - -cors: - allowed-origins: - - "http://localhost:5173" - - "http://localhost:5174" - - "https://pinit.go-gradually.me" - allowed-methods: - - GET - - POST - - PUT - - PATCH - - DELETE - - OPTIONS - allowed-headers: - - "*" - allow-credentials: true - max-age: 3600