Fix #4936: add the cookie consent theme control.

This commit is contained in:
Ben
2025-02-22 09:49:33 +08:00
parent 7a4ea8cf1b
commit 982f3b1943
14 changed files with 322 additions and 0 deletions

View File

@ -169,6 +169,13 @@ namespace Oqtane
options.CustomSchemaIds(type => type.ToString()); // Handle SchemaId already used for different type
});
services.TryAddSwagger(_useSwagger);
//add cookie consent policy
services.Configure<CookiePolicyOptions>(options =>
{
options.CheckConsentNeeded = context => true;
options.ConsentCookieValue = Constants.CookieConsentCookieValue;
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@ -225,6 +232,7 @@ namespace Oqtane
app.UseAuthentication();
app.UseAuthorization();
app.UseAntiforgery();
app.UseCookiePolicy();
if (_useSwagger)
{