diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/ProfileAppService.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/ProfileAppService.cs index 9749a607d59..d2baae83935 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/ProfileAppService.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/ProfileAppService.cs @@ -68,8 +68,8 @@ public virtual async Task UpdateAsync(UpdateProfileDto input) (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); diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs index 6b558157327..a56935424ed 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs @@ -184,8 +184,8 @@ protected virtual async Task UpdateUserByInput(IdentityUser user, IdentityUserCr 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)) {