예제 #1
0
        public async Task<IHttpActionResult> ChangePassword(ChangePasswordViewModel  changePasswordViewModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IdentityResult result = await _repo.ChangePassword(changePasswordViewModel);
            IHttpActionResult errorResult = GetErrorResult(result);
            if (errorResult != null)
            {
                return errorResult;
            }
            return Ok();
        }
예제 #2
0
 public async Task<IdentityResult> ChangePassword(ChangePasswordViewModel changePasswordViewModel)
 {
     IdentityResult result = await UserManager.ChangePasswordAsync(changePasswordViewModel.UserName, changePasswordViewModel.OldPassword, changePasswordViewModel.NewPassword);
     return result;
 }