Browse Source

Update IdentityUserManager.cs

pull/17990/head
Salih 3 years ago
parent
commit
1f20fb6466
  1. 26
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs

26
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs

@ -297,15 +297,20 @@ public class IdentityUserManager : UserManager<IdentityUser>, IDomainService
var result = await base.SetEmailAsync(user, email);
result.CheckErrors();
if (string.IsNullOrEmpty(oldMail) || oldMail.Equals(email, StringComparison.OrdinalIgnoreCase))
{
return result;
}
await DistributedEventBus.PublishAsync(
new IdentityUserEmailChangedEto
{
Id = user.Id,
TenantId = user.TenantId,
Email = email,
OldEmail = oldMail
});
new IdentityUserEmailChangedEto
{
Id = user.Id,
TenantId = user.TenantId,
Email = email,
OldEmail = oldMail
});
return result;
}
@ -317,6 +322,11 @@ public class IdentityUserManager : UserManager<IdentityUser>, IDomainService
var result = await base.SetUserNameAsync(user, userName);
result.CheckErrors();
if (string.IsNullOrEmpty(oldUserName) || oldUserName == userName)
{
return result;
}
await DistributedEventBus.PublishAsync(
new IdentityUserUserNameChangedEto {

Loading…
Cancel
Save