File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
ASP.NET Core/Web/AspNetCoreTemplate.Web Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 16
16
using Microsoft . AspNetCore . Builder ;
17
17
using Microsoft . AspNetCore . Hosting ;
18
18
using Microsoft . AspNetCore . Http ;
19
+ using Microsoft . AspNetCore . Mvc ;
19
20
using Microsoft . EntityFrameworkCore ;
20
21
using Microsoft . Extensions . Configuration ;
21
22
using Microsoft . Extensions . DependencyInjection ;
@@ -46,7 +47,11 @@ public void ConfigureServices(IServiceCollection services)
46
47
options . MinimumSameSitePolicy = SameSiteMode . None ;
47
48
} ) ;
48
49
49
- services . AddControllersWithViews ( ) ;
50
+ services . AddControllersWithViews ( options =>
51
+ {
52
+ options . Filters . Add ( new AutoValidateAntiforgeryTokenAttribute ( ) ) ;
53
+ } ) ;
54
+
50
55
services . AddRazorPages ( ) ;
51
56
52
57
services . AddSingleton ( this . configuration ) ;
You can’t perform that action at this time.
0 commit comments