Skip to content

Commit

Permalink
fix(auth): add workaround to get csrf on cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrouillet committed Jul 30, 2024
1 parent 11a733e commit 067d6c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception {
cookieCsrfTokenRepository.setCookieName("XSRF-TOKEN");
cookieCsrfTokenRepository.setCookieHttpOnly(false);
CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler();
requestHandler.setCsrfRequestAttributeName(null);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public PasswordEncoder passwordEncoder() {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler();
requestHandler.setCsrfRequestAttributeName(null);

CookieCsrfTokenRepository cookieCsrfTokenRepository = CookieCsrfTokenRepository.withHttpOnlyFalse();
cookieCsrfTokenRepository.setCookiePath("/");
Expand Down

0 comments on commit 067d6c4

Please sign in to comment.