Skip to content

Commit

Permalink
fix: cors 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
yj-leez committed Nov 25, 2023
1 parent bac6f3f commit 628da7b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;
Expand Down Expand Up @@ -46,6 +47,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti

http.authorizeRequests()
.requestMatchers("/v1/auth/**").permitAll()
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() // Preflight Request 허용해주기
.requestMatchers("/v1/**").authenticated();


Expand Down

0 comments on commit 628da7b

Please sign in to comment.