fix cookie policy

This commit is contained in:
Borja García Rodríguez 2020-12-23 11:57:15 +01:00
parent 71eda6aeb9
commit 8c7ff74194

View File

@ -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();
});
}
}