소스 검색

Publish CsrfTokenRepository as shared object

Closes gh-9595
Josh Cummings 4 년 전
부모
커밋
d19ff12813
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurer.java

+ 1 - 0
config/src/main/java/org/springframework/security/config/annotation/web/configurers/CsrfConfigurer.java

@@ -201,6 +201,7 @@ public final class CsrfConfigurer<H extends HttpSecurityBuilder<H>>
 	@SuppressWarnings("unchecked")
 	@Override
 	public void configure(H http) {
+		http.setSharedObject(CsrfTokenRepository.class, this.csrfTokenRepository);
 		CsrfFilter filter = new CsrfFilter(this.csrfTokenRepository);
 		RequestMatcher requireCsrfProtectionMatcher = getRequireCsrfProtectionMatcher();
 		if (requireCsrfProtectionMatcher != null) {