Skip to content

Commit

Permalink
chore : CORS 설정 변경, CORS는 리버스 프록시를 담당하는 Nginx가 처리하도록 함
Browse files Browse the repository at this point in the history
  • Loading branch information
GyuHo123 committed Jun 16, 2024
1 parent 6b91522 commit 0763637
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/main/kotlin/com/example/lsa/common/auth/SecurityConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,7 @@ class SecurityConfig(
.anyRequest().authenticated()
}
.csrf { csrf -> csrf.disable() }
.cors { cors ->
cors.configurationSource {
val configuration = CorsConfiguration().apply {
allowedOriginPatterns = listOf("https://*.com", "https://*.kr", "https://*.dev")
allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS")
allowedHeaders = listOf("*")
allowCredentials = true
}
configuration
}
}

.cors { cors -> cors.disable() }
.sessionManagement { it.sessionCreationPolicy(SessionCreationPolicy.STATELESS) }
http.addFilterBefore(jwtTokenFilter(), UsernamePasswordAuthenticationFilter::class.java)
return http.build()
Expand Down

0 comments on commit 0763637

Please sign in to comment.