Skip to content

Commit 9e3452e

Browse files
committed
Merge branch 'master' of github.com:NikolayIT/ASP.NET-MVC-Template
2 parents a98453c + e0705bd commit 9e3452e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ASP.NET Core/Web/AspNetCoreTemplate.Web/Startup.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.AspNetCore.Builder;
1717
using Microsoft.AspNetCore.Hosting;
1818
using Microsoft.AspNetCore.Http;
19+
using Microsoft.AspNetCore.Mvc;
1920
using Microsoft.EntityFrameworkCore;
2021
using Microsoft.Extensions.Configuration;
2122
using Microsoft.Extensions.DependencyInjection;
@@ -46,7 +47,11 @@ public void ConfigureServices(IServiceCollection services)
4647
options.MinimumSameSitePolicy = SameSiteMode.None;
4748
});
4849

49-
services.AddControllersWithViews();
50+
services.AddControllersWithViews(options =>
51+
{
52+
options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
53+
});
54+
5055
services.AddRazorPages();
5156

5257
services.AddSingleton(this.configuration);

0 commit comments

Comments
 (0)