Don't hook cancellation tokens by default (#1816)
This commit is contained in:
parent
9481e88aa1
commit
c66bd98a61
|
|
@ -166,7 +166,7 @@ namespace Microsoft.AspNetCore.Identity
|
|||
{
|
||||
RoleType = typeof(TRole);
|
||||
AddRoleValidator<RoleValidator<TRole>>();
|
||||
Services.TryAddScoped<RoleManager<TRole>, RoleManager<TRole>>();
|
||||
Services.TryAddScoped<RoleManager<TRole>>();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
// No interface for the error describer so we can add errors without rev'ing the interface
|
||||
services.TryAddScoped<IdentityErrorDescriber>();
|
||||
services.TryAddScoped<IUserClaimsPrincipalFactory<TUser>, UserClaimsPrincipalFactory<TUser>>();
|
||||
services.TryAddScoped<UserManager<TUser>, UserManager<TUser>>();
|
||||
services.TryAddScoped<UserManager<TUser>>();
|
||||
|
||||
if (setupAction != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
services.TryAddScoped<ISecurityStampValidator, SecurityStampValidator<TUser>>();
|
||||
services.TryAddScoped<ITwoFactorSecurityStampValidator, TwoFactorSecurityStampValidator<TUser>>();
|
||||
services.TryAddScoped<IUserClaimsPrincipalFactory<TUser>, UserClaimsPrincipalFactory<TUser, TRole>>();
|
||||
services.TryAddScoped<UserManager<TUser>, AspNetUserManager<TUser>>();
|
||||
services.TryAddScoped<SignInManager<TUser>, SignInManager<TUser>>();
|
||||
services.TryAddScoped<RoleManager<TRole>, AspNetRoleManager<TRole>>();
|
||||
services.TryAddScoped<UserManager<TUser>>();
|
||||
services.TryAddScoped<SignInManager<TUser>>();
|
||||
services.TryAddScoped<RoleManager<TRole>>();
|
||||
|
||||
if (setupAction != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Identity.Test
|
|||
var sp = services.BuildServiceProvider();
|
||||
Assert.NotNull(sp.GetRequiredService<IRoleValidator<PocoRole>>());
|
||||
Assert.IsType<NoopRoleStore>(sp.GetRequiredService<IRoleStore<PocoRole>>());
|
||||
Assert.NotNull(sp.GetRequiredService<RoleManager<PocoRole>>());
|
||||
Assert.IsType<RoleManager<PocoRole>>(sp.GetRequiredService<RoleManager<PocoRole>>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -153,7 +153,10 @@ namespace Microsoft.AspNetCore.Identity.Test
|
|||
{
|
||||
var services = new ServiceCollection()
|
||||
.AddSingleton<IConfiguration>(new ConfigurationBuilder().Build());
|
||||
services.AddIdentity<PocoUser,PocoRole>();
|
||||
services.AddLogging()
|
||||
.AddIdentity<PocoUser,PocoRole>()
|
||||
.AddUserStore<NoopUserStore>()
|
||||
.AddRoleStore<NoopRoleStore>();
|
||||
|
||||
var provider = services.BuildServiceProvider();
|
||||
var userValidator = provider.GetRequiredService<IUserValidator<PocoUser>>() as UserValidator<PocoUser>;
|
||||
|
|
@ -164,6 +167,9 @@ namespace Microsoft.AspNetCore.Identity.Test
|
|||
|
||||
var hasher = provider.GetRequiredService<IPasswordHasher<PocoUser>>() as PasswordHasher<PocoUser>;
|
||||
Assert.NotNull(hasher);
|
||||
|
||||
Assert.IsType<RoleManager<PocoRole>>(provider.GetRequiredService<RoleManager<PocoRole>>());
|
||||
Assert.IsType<UserManager<PocoUser>>(provider.GetRequiredService<UserManager<PocoUser>>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -89,10 +89,9 @@ namespace Microsoft.AspNetCore.Identity.Test
|
|||
store = store ?? new Mock<IRoleStore<TRole>>().Object;
|
||||
var roles = new List<IRoleValidator<TRole>>();
|
||||
roles.Add(new RoleValidator<TRole>());
|
||||
return new AspNetRoleManager<TRole>(store, roles,
|
||||
return new RoleManager<TRole>(store, roles,
|
||||
new UpperInvariantLookupNormalizer(),
|
||||
new IdentityErrorDescriber(),
|
||||
null,
|
||||
null);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue