Add explicit antiforgery configuration and better error handling for UpdateStatus

This commit is contained in:
2025-09-24 16:49:21 +01:00
parent 66c948e4d8
commit 96125d6042
3 changed files with 32 additions and 1 deletions

View File

@@ -21,6 +21,13 @@ builder.Host.UseSerilog();
builder.Services.AddControllers();
builder.Services.AddControllersWithViews(); // Add MVC for Admin Panel
// Configure Antiforgery
builder.Services.AddAntiforgery(options =>
{
options.HeaderName = "X-CSRF-TOKEN";
options.FormFieldName = "__RequestVerificationToken";
});
// Database
if (builder.Environment.EnvironmentName == "Testing")
{