Skip to content

Commit

Permalink
Merge pull request #20472 from abpframework/20460
Browse files Browse the repository at this point in the history
Trim the changed value when users change their first or last name.
  • Loading branch information
salihozkara authored Aug 12, 2024
2 parents 34a48b1 + c6aa291 commit a96ca55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public virtual async Task<ProfileDto> 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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit a96ca55

Please sign in to comment.