From 8c7ff741947c5061c7717cd89a76b51da1eaad37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Garc=C3=ADa=20Rodr=C3=ADguez?= Date: Wed, 23 Dec 2020 11:57:15 +0100 Subject: [PATCH] fix cookie policy --- src/Web/WebhookClient/Startup.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Web/WebhookClient/Startup.cs b/src/Web/WebhookClient/Startup.cs index e61affd18..f45a30b5d 100644 --- a/src/Web/WebhookClient/Startup.cs +++ b/src/Web/WebhookClient/Startup.cs @@ -61,7 +61,6 @@ namespace WebhookClient app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. } - app.UseAuthentication(); app.Map("/check", capp => { capp.Run(async (context) => @@ -92,12 +91,20 @@ namespace WebhookClient } }); }); + + // Fix samesite issue when running eShop from docker-compose locally as by default http protocol is being used + // Refer to https://github.com/dotnet-architecture/eShopOnContainers/issues/1391 + app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = SameSiteMode.Lax }); + app.UseStaticFiles(); app.UseSession(); app.UseRouting(); + app.UseAuthentication(); + app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); + endpoints.MapRazorPages(); }); } }