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 79b07c3 commit 7e3d4a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ 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 @@ -17,7 +17,7 @@ public void addCorsMappings(CorsRegistry registry) {
"http://localhost:3004"
) //ν”„λ‘ νŠΈ ν…ŒμŠ€νŠΈ urlμž…λ‹ˆλ‹€.
.allowedMethods("POST", "GET", "DELETE", "PUT", "PATCH", "OPTIONS")
.allowedHeaders("*")
.allowedHeaders("Content-Type", "Authorization")
.allowCredentials(true);
}
}

0 comments on commit 7e3d4a2

Please sign in to comment.