Skip to content

Commit

Permalink
πŸš‘ [HOTFIX] CORS μ—λŸ¬λ‘œ 인해 κΆŒν•œ μˆ˜μ •2
Browse files Browse the repository at this point in the history
  • Loading branch information
kchaeeun committed Aug 19, 2024
1 parent 818bacb commit 23c929f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.httpBasic(AbstractHttpConfigurer::disable) // http form login λΉ„ν™œμ„±ν™”
.csrf(AbstractHttpConfigurer::disable) // csrf ν•„ν„° λΉ„ν™œμ„±ν™” -> cookies μ‚¬μš©ν•˜μ§€ μ•ŠμœΌλ―€λ‘œ μœ„ν—˜ μ—†μŒ
// .cors(AbstractHttpConfigurer::disable)
.formLogin(AbstractHttpConfigurer::disable) // basic login λΉ„ν™œμ„±ν™”
.sessionManagement(sessionManagement -> sessionManagement.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) // session μ‚¬μš© X
.addFilterBefore(new JwtAuthenticationFilter(jwtService), UsernamePasswordAuthenticationFilter.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class WebConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000", "http://localhost:3007","http://localhost:3008") //ν”„λ‘ νŠΈ ν…ŒμŠ€νŠΈ urlμž…λ‹ˆλ‹€.
.allowedMethods("POST", "GET", "DELETE", "PUT", "PATCH")
.allowedHeaders("*")
.allowedMethods("POST", "GET", "DELETE", "PUT", "PATCH", "OPTIONS")
.allowedHeaders("Content-Type", "Authorization")
.allowCredentials(true);
}
}

0 comments on commit 23c929f

Please sign in to comment.