Refaktorisierung der Lokalisierung und DTO-Integration
- Ersetzung von ITranslateService durch IStringLocalizer<X> für verbesserte Lokalisierung. - Aktualisierung der DTO-Klassen entsprechend der neuesten Core.DTO-Struktur. - Integration der neuen Klassen Result und DataResult aus Core.DTO für standardisierte Serviceantworten.
This commit is contained in:
@@ -4,7 +4,6 @@ using DigitalData.UserManager.Application.Contracts;
|
||||
using DigitalData.UserManager.Application.Services;
|
||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||
using DigitalData.UserManager.Infrastructure.Contracts;
|
||||
using DigitalData.Core.CultureServices;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using NLog.Web;
|
||||
@@ -35,14 +34,13 @@ try {
|
||||
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddCookie(options =>
|
||||
{
|
||||
options.Cookie.HttpOnly = false;
|
||||
//options.Cookie.SecurePolicy = CookieSecurePolicy.Always; //always https
|
||||
options.Cookie.SameSite = SameSiteMode.None;
|
||||
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
|
||||
options.LoginPath = "/api/auth/login";
|
||||
options.LogoutPath = "/api/auth/logout";
|
||||
});
|
||||
|
||||
|
||||
builder.Services.AddDbContext<DDECMDbContext>(options =>
|
||||
options.UseSqlServer(builder.Configuration.GetConnectionString("DD_ECM_Connection"))
|
||||
.EnableDetailedErrors());
|
||||
@@ -61,15 +59,13 @@ try {
|
||||
});
|
||||
});
|
||||
|
||||
builder.Services.AddKeyTranslationService();
|
||||
|
||||
builder.Services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
|
||||
builder.Services.AddAutoMapper(typeof(GroupMappingProfile).Assembly);
|
||||
builder.Services.AddAutoMapper(typeof(GroupOfUserMappingProfile).Assembly);
|
||||
builder.Services.AddAutoMapper(typeof(ModuleMappingProfile).Assembly);
|
||||
builder.Services.AddAutoMapper(typeof(ModuleOfUserMappingProfile).Assembly);
|
||||
builder.Services.AddAutoMapper(typeof(UserRepMappingProfile).Assembly);
|
||||
builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly);
|
||||
//builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly);
|
||||
|
||||
builder.Services.AddScoped<IUserRepository, UserRepository>();
|
||||
builder.Services.AddScoped<IGroupRepository, GroupRepository>();
|
||||
@@ -86,7 +82,6 @@ try {
|
||||
builder.Services.AddScoped<IUserRepService, UserRepService>();
|
||||
|
||||
builder.Services.AddDirectorySearchService();
|
||||
builder.Services.AddResponseService();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user