示例#1
0
        public async Task <IHttpActionResult> ChangePassword(ChangingPasswordDTO model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            IdentityResult result = await _Repository.ChangePassword(User.Identity.GetUserId(), model);

            if (!result.Succeeded)
            {
                return(GetErrorResult(result));
            }

            return(Ok());
        }
示例#2
0
 public async Task <IdentityResult> ChangePassword(string id, ChangingPasswordDTO model)
 {
     return(await _userManager.ChangePasswordAsync(id, model.OldPassword, model.NewPassword));
 }