From fc626eb744f9865d6c631257d7b6c332a26133ee Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 3 Mar 2023 18:57:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20logout=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/cmm/web/XitLoginController.java | 25 +++++++++++++------ ...tIntercepter.java => MenuIntercepter.java} | 17 ++++--------- .../resources/spring/mvc/mvc-interceptor.xml | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) rename src/main/java/kr/xit/framework/core/interceptor/{XitMenuListIntercepter.java => MenuIntercepter.java} (91%) diff --git a/src/main/java/kr/xit/framework/biz/cmm/web/XitLoginController.java b/src/main/java/kr/xit/framework/biz/cmm/web/XitLoginController.java index b06f5178..ef80f373 100644 --- a/src/main/java/kr/xit/framework/biz/cmm/web/XitLoginController.java +++ b/src/main/java/kr/xit/framework/biz/cmm/web/XitLoginController.java @@ -15,6 +15,8 @@ import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.stereotype.Controller; @@ -29,11 +31,12 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.servlet.ModelAndView; +import egovframework.rte.fdl.security.config.SecurityConfig; import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import kr.xit.framework.biz.mng.user.dto.XitUserInfoVO; -import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.dto.XitLoginVO; +import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitLoginService; +import kr.xit.framework.biz.mng.user.dto.XitUserInfoVO; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.USER_SE; @@ -200,7 +203,15 @@ public class XitLoginController { public String actionLogout(HttpServletRequest request) { request.getSession().setAttribute("XitLoginSession", null); - return "redirect:/egov_security_logout.do"; + ApplicationContext act = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext()); + SecurityConfig config = (SecurityConfig)act.getBean(SecurityConfig.class); + String logoutSuccessUrl = config.getLogoutSuccessUrl(); + + SecurityContext context = SecurityContextHolder.getContext(); + context.setAuthentication(null); + + //return "redirect:/egov_security_logout.do"; + return "forward:" + logoutSuccessUrl; } /** @@ -260,8 +271,8 @@ public class XitLoginController { /** *
메소드 설명: 아이디 찾기 페이지 요청별  팝업
- * @param model - * @param session + * @param page + * @param vo * @return * @author: 김동규 * @throws Exception @@ -294,10 +305,8 @@ public class XitLoginController { /** *
메소드 설명: 비밀번호 찾기 페이지 요청별 팝업
- * @param model - * @param session * @param xitUserInfoVO - * @return + * @param page * @throws IOException * @throws SQLException * @throws RuntimeException String 요청처리 후 응답객체 diff --git a/src/main/java/kr/xit/framework/core/interceptor/XitMenuListIntercepter.java b/src/main/java/kr/xit/framework/core/interceptor/MenuIntercepter.java similarity index 91% rename from src/main/java/kr/xit/framework/core/interceptor/XitMenuListIntercepter.java rename to src/main/java/kr/xit/framework/core/interceptor/MenuIntercepter.java index e22a88c4..36cb45f9 100644 --- a/src/main/java/kr/xit/framework/core/interceptor/XitMenuListIntercepter.java +++ b/src/main/java/kr/xit/framework/core/interceptor/MenuIntercepter.java @@ -3,7 +3,6 @@ package kr.xit.framework.core.interceptor; import java.util.List; import java.util.Map; -import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -15,15 +14,13 @@ import com.fasterxml.jackson.databind.JsonMappingException; import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; import kr.xit.framework.biz.cache.util.CacheServiceUtils; +import kr.xit.framework.biz.cmm.dto.XitLoginVO; +import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.support.exception.JSONExceptionMessageWriter; import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.constants.Globals; import kr.xit.framework.support.util.constants.MessageKey; import lombok.extern.slf4j.Slf4j; -import kr.xit.framework.biz.cmm.service.XitFrameCrudService; -import kr.xit.framework.biz.cmm.service.XitFrameUnitService; -import kr.xit.framework.biz.cmm.dto.XitLoginVO; -import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; /** * @@ -37,11 +34,7 @@ import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; */ @Slf4j @Service -public class XitMenuListIntercepter extends HandlerInterceptorAdapter { - @Resource - private XitFrameUnitService xitFrameUnitService; - @Resource - private XitFrameCrudService xitFrameCrudService; +public class MenuIntercepter extends HandlerInterceptorAdapter { private Map chkUrlAddLength; @@ -59,7 +52,7 @@ public class XitMenuListIntercepter extends HandlerInterceptorAdapter { - log.info("MenuList interceptor START !!"); + log.debug("MenuIntercepter interceptor START !!"); /** * 필수값 설정 @@ -143,7 +136,7 @@ public class XitMenuListIntercepter extends HandlerInterceptorAdapter { - log.info("MenuList interceptor COMPLETE !!"); + log.debug("MenuIntercepter interceptor COMPLETE !!"); } diff --git a/src/main/resources/spring/mvc/mvc-interceptor.xml b/src/main/resources/spring/mvc/mvc-interceptor.xml index 6b8fbea1..79a6097f 100644 --- a/src/main/resources/spring/mvc/mvc-interceptor.xml +++ b/src/main/resources/spring/mvc/mvc-interceptor.xml @@ -25,7 +25,7 @@ - +