diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ChangePasswordInput.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ChangePasswordInput.cs new file mode 100644 index 0000000000..c4ea3bcc09 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ChangePasswordInput.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Volo.Abp.Identity +{ + public class ChangePasswordInput + { + public string CurrentPassword { get; set; } + + public string NewPassword { get; set; } + } +} diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs index 142b5ad16a..15d20e551e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IProfileAppService.cs @@ -9,6 +9,6 @@ namespace Volo.Abp.Identity Task UpdateAsync(UpdateProfileDto input); - Task ChangePasswordAsync(string currentPassword, string newPassword); + Task ChangePasswordAsync(ChangePasswordInput input); } } diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs index 64a78b81ca..cd0365be2f 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs @@ -50,10 +50,10 @@ namespace Volo.Abp.Identity return ObjectMapper.Map(user); } - public async Task ChangePasswordAsync(string currentPassword, string newPassword) + public async Task ChangePasswordAsync(ChangePasswordInput input) { var currentUser = await _userManager.GetByIdAsync(CurrentUser.GetId()); - (await _userManager.ChangePasswordAsync(currentUser, currentPassword, newPassword)).CheckErrors(); + (await _userManager.ChangePasswordAsync(currentUser, input.CurrentPassword, input.NewPassword)).CheckErrors(); } } } diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs index de05b9bdea..a87af4eef6 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs @@ -31,9 +31,9 @@ namespace Volo.Abp.Identity [HttpPost] [Route("change-password")] - public Task ChangePasswordAsync(string currentPassword, string newPassword) + public Task ChangePasswordAsync(ChangePasswordInput input) { - return _profileAppService.ChangePasswordAsync(currentPassword, newPassword); + return _profileAppService.ChangePasswordAsync(input); } } }