Browse Source
Fix tenant context when validating user uniqueness
pull/24456/head
maliming
7 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
5 additions and
1 deletions
-
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityUserValidator.cs
|
|
|
@ -109,7 +109,11 @@ namespace Volo.Abp.Identity |
|
|
|
{ |
|
|
|
using (TenantFilter.Disable()) |
|
|
|
{ |
|
|
|
var owner = await manager.FindByIdAsync(user.Id.ToString()); |
|
|
|
IdentityUser owner; |
|
|
|
using (CurrentTenant.Change(user.TenantId)) |
|
|
|
{ |
|
|
|
owner = await manager.FindByIdAsync(user.Id.ToString()); |
|
|
|
} |
|
|
|
var normalizedUserName = manager.NormalizeName(user.UserName); |
|
|
|
var normalizedEmail = manager.NormalizeEmail(user.Email); |
|
|
|
var users = await UserRepository.GetUsersByNormalizedUserNamesAsync([normalizedUserName!, normalizedEmail], true); |
|
|
|
|