Skip to content

Commit

Permalink
Merge pull request #167 from linkloud/fix/corsConfig
Browse files Browse the repository at this point in the history
Fix/cors config
  • Loading branch information
als904204 authored Oct 8, 2023
2 parents 1779c74 + 54f698f commit 0d3cb2f
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
return http
.cors().configurationSource(corsConfigurationSource())
.and()
.csrf().disable()
.formLogin().disable()
.httpBasic().disable()
Expand All @@ -56,18 +54,4 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception {
)
.build();
}

@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.addAllowedOrigin("https://linkloud.io");
configuration.addAllowedOrigin("http://localhost:5173");

configuration.addAllowedMethod("*"); // 모든 메소드 허용.
configuration.addAllowedHeader("*");
configuration.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}
}

0 comments on commit 0d3cb2f

Please sign in to comment.