Fix merge conflict
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
@ -34,7 +35,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
|
||||
public static IServiceCollection AddOqtaneDbContext(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<IDbConfig, DbConfig>();
|
||||
services.AddDbContext<MasterDBContext>(options => { });
|
||||
services.AddDbContext<TenantDBContext>(options => { });
|
||||
|
||||
@ -62,6 +62,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
services.AddSingleton<IInstallationManager, InstallationManager>();
|
||||
services.AddSingleton<ISyncManager, SyncManager>();
|
||||
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
||||
services.AddSingleton<IConfigManager, ConfigManager>();
|
||||
|
||||
return services;
|
||||
}
|
||||
@ -96,6 +97,8 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
services.AddTransient<ISqlRepository, SqlRepository>();
|
||||
services.AddTransient<IUpgradeManager, UpgradeManager>();
|
||||
services.AddTransient<ILanguageRepository, LanguageRepository>();
|
||||
// obsolete - replaced by ITenantManager
|
||||
services.AddTransient<ITenantResolver, TenantResolver>();
|
||||
|
||||
return services;
|
||||
}
|
||||
@ -105,12 +108,19 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
options.Cookie.HttpOnly = false;
|
||||
options.Cookie.SameSite = SameSiteMode.Strict;
|
||||
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
|
||||
options.Events.OnRedirectToLogin = context =>
|
||||
{
|
||||
context.Response.StatusCode = 401;
|
||||
|
||||
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
options.Events.OnRedirectToAccessDenied = context =>
|
||||
{
|
||||
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
options.Events.OnValidatePrincipal = PrincipalValidator.ValidateAsync;
|
||||
});
|
||||
|
||||
return services;
|
||||
|
Reference in New Issue
Block a user