diff --git a/src/main/kotlin/top/fatweb/oxygen/api/handler/JwtAccessDeniedHandler.kt b/src/main/kotlin/top/fatweb/oxygen/api/handler/JwtAccessDeniedHandler.kt index 2c89073..294b888 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/handler/JwtAccessDeniedHandler.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/handler/JwtAccessDeniedHandler.kt @@ -18,7 +18,6 @@ class JwtAccessDeniedHandler : AccessDeniedHandler { override fun handle( request: HttpServletRequest?, response: HttpServletResponse?, accessDeniedException: AccessDeniedException? ) { - request?.setAttribute("filter.error", accessDeniedException) - request?.getRequestDispatcher("/error/thrown")?.forward(request, response) + throw accessDeniedException ?: AccessDeniedException("Access Denied") } } \ No newline at end of file