|
|
@@ -0,0 +1,18 @@
|
|
|
+package com.example.ili_web.event_handler;
|
|
|
+
|
|
|
+import jakarta.servlet.ServletException;
|
|
|
+import jakarta.servlet.http.HttpServletRequest;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.security.access.AccessDeniedException;
|
|
|
+import org.springframework.security.web.access.AccessDeniedHandler;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+@Slf4j
|
|
|
+public class CustomAccessDeniedHandler implements AccessDeniedHandler {
|
|
|
+ @Override
|
|
|
+ public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException {
|
|
|
+ log.error("인가된 사용자가 아닙니다.");
|
|
|
+
|
|
|
+ }
|
|
|
+}
|