diff --git a/src/main/kotlin/com/wafflestudio/csereal/common/config/SecurityConfig.kt b/src/main/kotlin/com/wafflestudio/csereal/common/config/SecurityConfig.kt index d5d4b358..b7cfd87e 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/common/config/SecurityConfig.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/common/config/SecurityConfig.kt @@ -15,6 +15,7 @@ import org.springframework.security.core.Authentication import org.springframework.security.web.SecurityFilterChain import org.springframework.security.web.authentication.logout.LogoutSuccessHandler import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler +import org.springframework.security.web.csrf.CookieCsrfTokenRepository import org.springframework.web.cors.CorsConfiguration import org.springframework.web.cors.CorsConfigurationSource import org.springframework.web.cors.UrlBasedCorsConfigurationSource @@ -34,6 +35,9 @@ class SecurityConfig( fun filterChain(http: HttpSecurity): SecurityFilterChain { return http .cors { } + .csrf { csrf -> + csrf.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) + } .oauth2Login { oauth2 -> oauth2 .loginPage("$loginPage/oauth2/authorization/idsnucse")