Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller

# Conflicts:
#	src/Umbraco.Infrastructure/PropertyEditors/PropertyEditorsComposer.cs
This commit is contained in:
Shannon
2020-11-18 16:02:51 +11:00
153 changed files with 1147 additions and 1111 deletions

View File

@@ -87,14 +87,21 @@ namespace Umbraco.Extensions
services.GetRequiredService<IJsonSerializer>()));
services.TryAddScoped<IUserConfirmation<BackOfficeIdentityUser>, DefaultUserConfirmation<BackOfficeIdentityUser>>();
services.TryAddScoped<IUserClaimsPrincipalFactory<BackOfficeIdentityUser>, UserClaimsPrincipalFactory<BackOfficeIdentityUser>>();
services.TryAddScoped<UserManager<BackOfficeIdentityUser>>();
// CUSTOM:
services.TryAddScoped<BackOfficeLookupNormalizer>();
services.TryAddScoped<BackOfficeIdentityErrorDescriber>();
services.TryAddScoped<IIpResolver, AspNetCoreIpResolver>();
services.TryAddSingleton<IBackOfficeExternalLoginProviders, NopBackOfficeExternalLoginProviders>();
/*
* IdentityBuilderExtensions.AddUserManager adds UserManager<BackOfficeIdentityUser> to service collection
* To validate the container the following registrations are required (dependencies of UserManager<T>)
* Perhaps we shouldn't be registering UserManager<T> at all and only registering/depending the UmbracoBackOffice prefixed types.
*/
services.TryAddScoped<ILookupNormalizer, BackOfficeLookupNormalizer>();
services.TryAddScoped<IdentityErrorDescriber, BackOfficeIdentityErrorDescriber>();
return new BackOfficeIdentityBuilder(services);
}
}

View File

@@ -1,7 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.BackOffice.Controllers;
using Umbraco.Web.Common.Controllers;
using Umbraco.Web.Common.Install;
using Umbraco.Web.BackOffice.Trees;
// the namespace here is intentional - although defined in Umbraco.Web assembly,
@@ -27,26 +24,5 @@ namespace Umbraco.Extensions
=> composition.WithCollectionBuilder<TreeCollectionBuilder>();
#endregion
/// <summary>
/// Registers Umbraco backoffice controllers.
/// </summary>
public static Composition ComposeUmbracoBackOfficeControllers(this Composition composition)
{
composition.RegisterControllers(new []
{
typeof(BackOfficeController),
typeof(PreviewController),
typeof(AuthenticationController),
typeof(InstallController),
typeof(InstallApiController),
});
var umbracoAuthorizedApiControllers = composition.TypeLoader.GetTypes<UmbracoApiController>();
composition.RegisterControllers(umbracoAuthorizedApiControllers);
return composition;
}
}
}