mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-05-18 04:05:54 +00:00
27 lines
1.0 KiB
Java
27 lines
1.0 KiB
Java
![]() |
package stirling.software.SPDF.config.security;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.security.core.Authentication;
|
||
|
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||
|
import org.springframework.stereotype.Component;
|
||
|
|
||
|
import jakarta.servlet.ServletException;
|
||
|
import jakarta.servlet.http.HttpServletRequest;
|
||
|
import jakarta.servlet.http.HttpServletResponse;
|
||
|
|
||
|
@Component
|
||
|
public class CustomAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
|
||
|
|
||
|
@Autowired
|
||
|
private LoginAttemptService loginAttemptService;
|
||
|
|
||
|
@Override
|
||
|
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
|
||
|
String username = request.getParameter("username");
|
||
|
loginAttemptService.loginSucceeded(username);
|
||
|
super.onAuthenticationSuccess(request, response, authentication);
|
||
|
}
|
||
|
}
|