All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mkopylec.recaptcha.security.login.LoginFailuresClearingHandler Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
package com.github.mkopylec.recaptcha.security.login;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class LoginFailuresClearingHandler extends SavedRequestAwareAuthenticationSuccessHandler {

    protected final LoginFailuresManager failuresManager;

    public LoginFailuresClearingHandler(LoginFailuresManager failuresManager) {
        this.failuresManager = failuresManager;
    }

    @Override
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
        failuresManager.clearLoginFailures(request);
        super.onAuthenticationSuccess(request, response, authentication);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy