From 24c669b0be71aaba8a04c33553fd6bb6d4892cb9 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Fri, 24 Jul 2026 13:14:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=91=EA=B7=BC=20=EA=B6=8C=ED=95=9C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EB=B0=8F=20=EA=B6=8C=ED=95=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EA=B0=9C=EC=84=A0:=20-=20=EB=AF=B8=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=82=AC=EC=9A=A9=EC=9E=90=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20=EC=8B=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89?= =?UTF-8?q?=ED=8A=B8=20=EC=B2=98=EB=A6=AC=20-=20Webhook=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=A0=91=EA=B7=BC=20=EA=B6=8C=ED=95=9C=20`ROLE=5FA?= =?UTF-8?q?PI=5FKEY=5FREQUEST`=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20-=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=8A=A4?= =?UTF-8?q?=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95:=20`white-space:=20pre-?= =?UTF-8?q?line`=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/PortalGlobalExceptionHandler.java | 11 ++++++++++- src/main/resources/templates/views/error.html | 1 + .../views/fragment/djbank/header_container.html | 4 ++-- .../views/fragment/djbank/service_sidebar.html | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/eactive/apim/portal/common/exception/PortalGlobalExceptionHandler.java b/src/main/java/com/eactive/apim/portal/common/exception/PortalGlobalExceptionHandler.java index e848f6d..8f3d8f4 100644 --- a/src/main/java/com/eactive/apim/portal/common/exception/PortalGlobalExceptionHandler.java +++ b/src/main/java/com/eactive/apim/portal/common/exception/PortalGlobalExceptionHandler.java @@ -7,6 +7,7 @@ import java.util.Map; import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; +import com.eactive.apim.portal.common.util.SecurityUtil; import com.eactive.apim.portal.config.PortalProperties; import com.eactive.apim.portal.file.exception.InvalidFileException; import lombok.RequiredArgsConstructor; @@ -54,7 +55,15 @@ public class PortalGlobalExceptionHandler { @ExceptionHandler(value = AccessDeniedException.class) public ModelAndView handleAccessDeniedException(HttpServletRequest request, AccessDeniedException ex) { - return new ModelAndView("redirect:/login"); + // 미로그인 사용자는 로그인 페이지로 유도, 로그인 상태에서의 권한 부족은 오류 안내 페이지로 표시한다. + if (!SecurityUtil.isAuthenticated()) { + return new ModelAndView("redirect:/login"); + } + log.warn("접근 권한 없음: loginId={}, uri={}", SecurityUtil.getCurrentLoginId(), request.getRequestURI()); + ModelAndView modelAndView = new ModelAndView("error"); + modelAndView.addObject("errorTitle", "페이지 접근 권한이 없습니다."); + modelAndView.addObject("errorDescription", "해당 페이지를 이용할 수 있는 권한이 없는 계정입니다.\n권한이 필요한 경우 관리자에게 문의해 주세요."); + return modelAndView; } @ExceptionHandler(value = PortalRedirectException.class) diff --git a/src/main/resources/templates/views/error.html b/src/main/resources/templates/views/error.html index 1ee833e..49a6169 100644 --- a/src/main/resources/templates/views/error.html +++ b/src/main/resources/templates/views/error.html @@ -75,6 +75,7 @@ color: #212529; text-align: center; line-height: 1.6; + white-space: pre-line; } .error-buttons { diff --git a/src/main/resources/templates/views/fragment/djbank/header_container.html b/src/main/resources/templates/views/fragment/djbank/header_container.html index 1353991..87aeaa4 100644 --- a/src/main/resources/templates/views/fragment/djbank/header_container.html +++ b/src/main/resources/templates/views/fragment/djbank/header_container.html @@ -93,7 +93,7 @@
  • 인증 키 관리 - Webhook 관리 + Webhook 관리 이용 통계
  • 내 정보 관리
  • @@ -250,7 +250,7 @@