ErrorView und ErrorViewModel hinzugefügt; ContactLink als Singleton konfiguriert, serialisiert aus appSettings
This commit is contained in:
@@ -14,6 +14,7 @@ using DigitalData.Core.API;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using DigitalData.Core.Application;
|
||||
using DigitalData.UserManager.Application.MappingProfiles;
|
||||
using EnvelopeGenerator.Web.Models;
|
||||
|
||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||
logger.Info("Logging initialized!");
|
||||
@@ -105,10 +106,10 @@ try
|
||||
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddCookie(options =>
|
||||
{
|
||||
options.Cookie.HttpOnly = true; // Makes the cookie inaccessible to client-side scripts for security
|
||||
options.Cookie.HttpOnly = true; // Makes the cookie inaccessible to client-side scripts for security
|
||||
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; // Ensures cookies are sent over HTTPS only
|
||||
options.Cookie.SameSite = SameSiteMode.Strict; // Protects against CSRF attacks by restricting how cookies are sent with requests from external sites
|
||||
// Set up event handlers for dynamic login and logout paths
|
||||
|
||||
options.Events = new CookieAuthenticationEvents
|
||||
{
|
||||
OnRedirectToLogin = context =>
|
||||
@@ -132,6 +133,8 @@ try
|
||||
};
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton(_ => builder.Configuration.GetSection("ContactLink").Get<ContactLink>() ?? new ContactLink());
|
||||
|
||||
builder.Services.AddCookieConsentSettings();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
Reference in New Issue
Block a user