diff --git a/src/handlers/auth_handler.cr b/src/handlers/auth_handler.cr index 0bdadfe..b6891d5 100644 --- a/src/handlers/auth_handler.cr +++ b/src/handlers/auth_handler.cr @@ -84,8 +84,8 @@ class AuthHandler < Kemal::Handler end if should_reject env.response.status_code = 403 - message = "HTTP 403: You are not authorized to visit #{env.request.path}" - send_error_page + send_error_page "HTTP 403: You are not authorized to visit " \ + "#{env.request.path}" return end end diff --git a/src/util/web.cr b/src/util/web.cr index fd7e873..03c114d 100644 --- a/src/util/web.cr +++ b/src/util/web.cr @@ -1,5 +1,6 @@ # Web related helper functions/macros +# This macro defines `is_admin` when used macro check_admin_access is_admin = false # The token (if exists) takes precedence over the default user option. @@ -28,7 +29,8 @@ macro layout(name) end end -macro send_error_page +macro send_error_page(msg) + message = {{msg}} base_url = Config.current.base_url check_admin_access page = "Error"