|
|
@@ -6,8 +6,13 @@ import javax.servlet.ServletException;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.gagaframework.web.parameter.GagaParameterUtil;
|
|
|
+import com.gagaframework.web.rest.client.GagaRequest;
|
|
|
+import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
+import com.style24.front.support.env.TsfConstants;
|
|
|
import com.style24.front.support.exception.TsfNonCertificationAccountException;
|
|
|
import com.style24.persistence.domain.Login;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.core.AuthenticationException;
|
|
|
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
|
|
|
@@ -44,7 +49,13 @@ public class TsfLoginFailureHandler implements AuthenticationFailureHandler {
|
|
|
AuthenticationException exception) throws IOException, ServletException {
|
|
|
|
|
|
// 로그인 실패 남기기
|
|
|
- loginService.createLoginFail(request.getParameter("loginId"), "Y");
|
|
|
+ String loginId;
|
|
|
+ if (StringUtils.isNotBlank(request.getParameter("loginId"))) {
|
|
|
+ loginId = request.getParameter("loginId");
|
|
|
+ } else {
|
|
|
+ loginId = request.getParameter("snsType") +"_" + GagaStringUtil.replace(request.getParameter("snsId"), TsfConstants.SNSLOGIN_PREFIX, "");
|
|
|
+ }
|
|
|
+ loginService.createLoginFail(loginId, "Y");
|
|
|
|
|
|
GagaMap result = new GagaMap();
|
|
|
result.setString("message", exception.getMessage());
|
|
|
@@ -65,11 +76,11 @@ public class TsfLoginFailureHandler implements AuthenticationFailureHandler {
|
|
|
result.setString("status", "ETC_ERROR");
|
|
|
}
|
|
|
|
|
|
- Login loginFailInfo = loginService.getLoginFailInfo(request.getParameter("loginId"));
|
|
|
+ Login loginFailInfo = loginService.getLoginFailInfo(loginId);
|
|
|
|
|
|
// 실패 횟수 10회 이상이면서 3분 지난경우 초기화 해준다.
|
|
|
if (loginFailInfo.getLoginFailCnt() >= 10 && loginFailInfo.getBlockSecs() <= 0) {
|
|
|
- loginService.updateLoginFailInfo(request.getParameter("loginId"));
|
|
|
+ loginService.updateLoginFailInfo(loginId);
|
|
|
}
|
|
|
// 로그인실패정보 조회
|
|
|
result.set("loginFailInfo", loginFailInfo);
|