This commit is contained in:
Anthony Stirling
2023-12-27 00:53:31 +00:00
parent 6ee8e1e37f
commit 659af2089c
3 changed files with 54 additions and 7 deletions

View File

@@ -48,6 +48,9 @@ public class SecurityConfiguration {
@Autowired
private LoginAttemptService loginAttemptService;
@Autowired
private FirstLoginFilter firstLoginFilter;
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.addFilterBefore(userAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
@@ -55,8 +58,8 @@ public class SecurityConfiguration {
if(loginEnabledValue) {
http.csrf(csrf -> csrf.disable());
//http.addFilterBefore(rateLimitingFilter(), UsernamePasswordAuthenticationFilter.class);
//http.addFilterAfter(firstLoginFilter, UsernamePasswordAuthenticationFilter.class);
http.addFilterBefore(rateLimitingFilter(), UsernamePasswordAuthenticationFilter.class);
http.addFilterAfter(firstLoginFilter, UsernamePasswordAuthenticationFilter.class);
http
.formLogin(formLogin -> formLogin
.loginPage("/login")