From ba9a49b0db85f564f7219c3e0524096e4d439e90 Mon Sep 17 00:00:00 2001 From: BinaryHuman Date: Wed, 26 Aug 2026 19:16:21 +0300 Subject: [PATCH] Fixes view script loading and request handling on the web frontend Executes the view scripts after the application scripts have loaded, both on the initial page load and during AJAX navigation, instead of running them during HTML parsing when the API helpers are not defined yet. Sends an empty JSON object for requests without a payload, because FastEndpoints parses the JSON body when the content type is application/json. Adds the antiforgery token to the management views that issue protected write requests. --- .../Core/Views/Admin/ManagePermissions.cshtml | 5 +- .../Core/Views/Admin/ManageRoles.cshtml | 5 +- .../Core/Views/Admin/Plugins.cshtml | 3 +- .../Core/Views/Admin/Themes.cshtml | 3 +- .../Core/Views/Auth/ChangePassword.cshtml | 3 +- .../Core/Views/Auth/Login.cshtml | 3 +- .../Core/Views/Auth/RecoverPassword.cshtml | 3 +- .../Core/Views/Auth/Register.cshtml | 3 +- .../Core/Views/Home/Index.cshtml | 3 +- .../Views/Library/Management/Index.cshtml | 5 +- .../Core/Views/Library/Management/Item.cshtml | 3 +- .../BookLibrary/Books/Index.cshtml | 3 +- .../Core/Views/Tools/Settings.cshtml | 3 +- .../wwwroot/js/site.js | 134 ++++++++++-------- 14 files changed, 109 insertions(+), 70 deletions(-) diff --git a/src/Lumina.Presentation.Web/Core/Views/Admin/ManagePermissions.cshtml b/src/Lumina.Presentation.Web/Core/Views/Admin/ManagePermissions.cshtml index 2dbe731d..e41eab20 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Admin/ManagePermissions.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Admin/ManagePermissions.cshtml @@ -18,6 +18,8 @@ @inject IViewLocalizer _localizer @inject IUrlService _urlService +@Html.AntiForgeryToken() +
@@ -101,7 +103,8 @@ @section Scripts { -