Browse Source

Merge pull request #20472 from abpframework/20460

Trim the changed value when users change their first or last name.
pull/20480/head
SALİH ÖZKARA 2 years ago
committed by GitHub
parent
commit
a96ca55d44
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/ProfileAppService.cs
  2. 4
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

4
modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/ProfileAppService.cs

@ -68,8 +68,8 @@ public class ProfileAppService : IdentityAppServiceBase, IProfileAppService
(await UserManager.SetPhoneNumberAsync(user, input.PhoneNumber)).CheckErrors();
}
user.Name = input.Name;
user.Surname = input.Surname;
user.Name = input.Name?.Trim();
user.Surname = input.Surname?.Trim();
input.MapExtraPropertiesTo(user);

4
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

@ -184,8 +184,8 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe
user.SetIsActive(input.IsActive);
}
user.Name = input.Name;
user.Surname = input.Surname;
user.Name = input.Name?.Trim();
user.Surname = input.Surname?.Trim();
(await UserManager.UpdateAsync(user)).CheckErrors();
if (input.RoleNames != null && await PermissionChecker.IsGrantedAsync(IdentityPermissions.Users.ManageRoles))
{

Loading…
Cancel
Save