Skip to content

Commit

Permalink
Merge pull request #4239 from sbwalker/dev
Browse files Browse the repository at this point in the history
require AntiForgery on Static Rendered components
  • Loading branch information
sbwalker authored May 8, 2024
2 parents 5ca5ad2 + bf4052b commit 7a25035
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Antiforgery;

namespace OqtaneSSR.Extensions
{
Expand All @@ -23,6 +24,7 @@ public static void MapFallback(this IEndpointRouteBuilder endpoints)
{
routeEndpointBuilder.Metadata.Add(new RootComponentMetadata(typeof(App)));
routeEndpointBuilder.Metadata.Add(new ComponentTypeMetadata(typeof(App)));
routeEndpointBuilder.Metadata.Add(new RequireAntiforgeryTokenAttribute());
});
}
}
Expand Down
1 change: 1 addition & 0 deletions Oqtane.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ISyncMan
app.UseCors();
app.UseAuthentication();
app.UseAuthorization();
app.UseAntiforgery();

if (_useSwagger)
{
Expand Down

0 comments on commit 7a25035

Please sign in to comment.