|
|
@ -2,6 +2,7 @@
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
|
|
using Volo.Abp.AutoMapper;
|
|
|
|
using Volo.Abp.Domain;
|
|
|
|
using Volo.Abp.Domain;
|
|
|
|
using Volo.Abp.EventBus.Distributed;
|
|
|
|
using Volo.Abp.EventBus.Distributed;
|
|
|
|
using Volo.Abp.Modularity;
|
|
|
|
using Volo.Abp.Modularity;
|
|
|
@ -12,17 +13,27 @@ namespace Volo.Abp.Identity
|
|
|
|
[DependsOn(
|
|
|
|
[DependsOn(
|
|
|
|
typeof(AbpDddDomainModule),
|
|
|
|
typeof(AbpDddDomainModule),
|
|
|
|
typeof(AbpIdentityDomainSharedModule),
|
|
|
|
typeof(AbpIdentityDomainSharedModule),
|
|
|
|
typeof(AbpUsersDomainModule)
|
|
|
|
typeof(AbpUsersDomainModule),
|
|
|
|
|
|
|
|
typeof(AbpAutoMapperModule)
|
|
|
|
)]
|
|
|
|
)]
|
|
|
|
public class AbpIdentityDomainModule : AbpModule
|
|
|
|
public class AbpIdentityDomainModule : AbpModule
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Configure<AbpDistributedEventBusOptions>(options =>
|
|
|
|
context.Services.AddAutoMapperObjectMapper<AbpIdentityDomainModule>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Configure<AbpAutoMapperOptions>(options =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
options.EtoMappings.Add<IdentityUser, UserEto>();
|
|
|
|
options.AddProfile<IdentityDomainMappingProfile>(validate: true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Configure<AbpDistributedEventBusOptions>(options =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options.EtoMappings.Add<IdentityUser, UserEto>(typeof(AbpIdentityDomainModule));
|
|
|
|
|
|
|
|
options.EtoMappings.Add<IdentityClaimType, IdentityClaimTypeEto>(typeof(AbpIdentityDomainModule));
|
|
|
|
|
|
|
|
options.EtoMappings.Add<IdentityRole, IdentityRoleEto>(typeof(AbpIdentityDomainModule));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var identityBuilder = context.Services.AddAbpIdentity(options =>
|
|
|
|
var identityBuilder = context.Services.AddAbpIdentity(options =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
options.User.RequireUniqueEmail = true;
|
|
|
|
options.User.RequireUniqueEmail = true;
|
|
|
|