Skip to content

Commit 122e881

Browse files
committed
Add AutoValidateAntiforgeryTokenAttribute filter.
1 parent 052285f commit 122e881

File tree

1 file changed

+5
-1
lines changed
  • src/AbpCompanyName.AbpProjectName.Web/Startup

1 file changed

+5
-1
lines changed

src/AbpCompanyName.AbpProjectName.Web/Startup/Startup.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Castle.Facilities.Logging;
77
using Microsoft.AspNetCore.Builder;
88
using Microsoft.AspNetCore.Hosting;
9+
using Microsoft.AspNetCore.Mvc;
910
using Microsoft.Extensions.DependencyInjection;
1011
using Microsoft.Extensions.Logging;
1112

@@ -21,7 +22,10 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
2122
DbContextOptionsConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
2223
});
2324

24-
services.AddMvc();
25+
services.AddMvc(options =>
26+
{
27+
options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
28+
});
2529

2630
//Configure Abp and Dependency Injection
2731
return services.AddAbp<AbpProjectNameWebModule>(options =>

0 commit comments

Comments
 (0)