From e2ad9e15056702a0a8a7256da777e3c3b984e46e Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Sun, 4 Oct 2020 14:09:24 +0300 Subject: [PATCH] Update BookStoreAccessDeniedHandler class Signed-off-by: Pekka Helenius --- .../service/session/BookStoreAccessDeniedHandler.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAccessDeniedHandler.java b/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAccessDeniedHandler.java index adf6c77..f2162ce 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAccessDeniedHandler.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAccessDeniedHandler.java @@ -12,7 +12,6 @@ import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.web.access.AccessDeniedHandler; -import org.springframework.stereotype.Component; import com.fjordtek.bookstore.service.HttpServerLogger; @@ -26,7 +25,6 @@ import com.fjordtek.bookstore.service.HttpServerLogger; * @author Pekka Helenius */ -@Component public class BookStoreAccessDeniedHandler implements AccessDeniedHandler { private HttpServerLogger httpServerLogger = new HttpServerLogger(); @@ -45,8 +43,7 @@ public class BookStoreAccessDeniedHandler implements AccessDeniedHandler { httpServerLogger.log(requestData, responseData); } - responseData.setHeader("Location", "/"); - responseData.setStatus(302); + responseData.sendRedirect("/"); } } \ No newline at end of file