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 @@