require AntiForgery on Static Rendered components

This commit is contained in:
sbwalker 2024-05-08 14:42:39 -04:00
parent f7895823cb
commit bf4052b550
2 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Routing;
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Antiforgery;
namespace OqtaneSSR.Extensions
{
@ -23,6 +24,7 @@ namespace OqtaneSSR.Extensions
{
routeEndpointBuilder.Metadata.Add(new RootComponentMetadata(typeof(App)));
routeEndpointBuilder.Metadata.Add(new ComponentTypeMetadata(typeof(App)));
routeEndpointBuilder.Metadata.Add(new RequireAntiforgeryTokenAttribute());
});
}
}

View File

@ -216,6 +216,7 @@ namespace Oqtane
app.UseCors();
app.UseAuthentication();
app.UseAuthorization();
app.UseAntiforgery();
if (_useSwagger)
{