|
|
|
|
@ -85,7 +85,9 @@ public class WebSecurityConfig { // extends WebSecurityConfigurerAdapter {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
|
|
http.csrf(AbstractHttpConfigurer::disable)
|
|
|
|
|
http
|
|
|
|
|
.csrf(AbstractHttpConfigurer::disable)
|
|
|
|
|
.cors(cors -> {}) // ← CORS 설정 추가!
|
|
|
|
|
.exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
|
|
|
|
|
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
|
|
|
|
.authorizeHttpRequests(auth ->
|
|
|
|
|
@ -96,7 +98,6 @@ public class WebSecurityConfig { // extends WebSecurityConfigurerAdapter {
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
http.authenticationProvider(authenticationProvider());
|
|
|
|
|
|
|
|
|
|
http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
|
|
|
|
|
|
|
|
|
|
return http.build();
|
|
|
|
|
|