Cookie-basierte automatische Autorisierung wurde konfiguriert. Middlevare für Benutzerberechtigung hinzugefügt
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
@using DigitalData.Core.Application.DTO;
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
@using Newtonsoft.Json.Serialization;
|
||||
@using Newtonsoft.Json;
|
||||
@inject CookieConsentSettings _cookieSettings
|
||||
@{
|
||||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
|
||||
var showBanner = !consentFeature?.CanTrack ?? false;
|
||||
var cookieString = consentFeature?.CreateConsentCookie();
|
||||
}
|
||||
@if (showBanner)
|
||||
{
|
||||
<script>
|
||||
@{
|
||||
var serializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
};
|
||||
string serializedProps = JsonConvert.SerializeObject(_cookieSettings, serializerSettings);
|
||||
}
|
||||
var props = @Html.Raw(serializedProps);
|
||||
var cookieSettings = new BootstrapCookieConsentSettings(props)
|
||||
</script>
|
||||
}
|
||||
@@ -19,13 +19,12 @@
|
||||
<script src="~/js/network.js" asp-append-version="true"></script>
|
||||
<script src="~/js/app.js" asp-append-version="true"></script>
|
||||
<script src="~/lib/pspdfkit/pspdfkit.js" asp-append-version="true"></script>
|
||||
<script src="~/lib/bootstrap-cookie-consent-settings-main/src/bootstrap-cookie-consent-settings.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
<main role="main">
|
||||
<partial name="_CookieConsentPartial" />
|
||||
@RenderBody()
|
||||
</main>
|
||||
|
||||
|
||||
|
||||
@Html.AntiForgeryToken()
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user