Spring Seurity 적용 후 잘 되던 회원가입 기능이 동작하지 않는 문제가 발생했다.
csrf 무시 설정을 적용하지 않아서였다.
해결법
http.
authorizeRequests()
....
.and()
.csrf().ignoringAntMatchers("/signup")
.and()
...
//아예 csrf 설정을 끌 수도 있다.
csrf().disable()
<form method="post" action="/signup">
...
<input type='hidden' name='${_csrf.parameterName }' value='${_csrf.token }'>
</from>
1번 방법의 경우 보안이 취약해지므로 지양해야한다.