Skip to content

Commit

Permalink
Merge branch '7.0.x' into renovate/gradle-8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole authored Nov 22, 2024
2 parents 2338777 + 3b8f4af commit 503cff4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import grails.gsp.TagLib
import groovy.transform.CompileStatic
import groovy.util.logging.Commons
import org.grails.plugins.web.GrailsTagDateHelper
import org.springframework.beans.BeansException

import java.text.DateFormat
import java.text.DateFormatSymbols
Expand Down Expand Up @@ -76,6 +77,10 @@ class FormTagLib implements ApplicationContextAware, InitializingBean, TagLibrar
if (applicationContext.containsBean('mvcConversionService')) {
conversionService = applicationContext.getBean('mvcConversionService', ConversionService)
}
configureCsrf()
}

void configureCsrf() {
try {
var filterChainProxy = applicationContext.getBean(
Class.forName("org.springframework.security.web.FilterChainProxy"))
Expand All @@ -85,7 +90,7 @@ class FormTagLib implements ApplicationContextAware, InitializingBean, TagLibrar
springSecurityCsrfTokenClass =
Class.forName("org.springframework.security.web.csrf.CsrfToken")
}
} catch (ClassNotFoundException ignore) {}
} catch (ClassNotFoundException | BeansException ignore) {}
}

/**
Expand Down

0 comments on commit 503cff4

Please sign in to comment.