Esempio n. 1
0
 public async Task<ApiResponse<EmptyObject>>ChangePassword(ChangePasswordBindingModel model, string authToken)
 {
     RestRequest request = GetNewRequest();
     request.Resource = "ChangePassword";
     request.Method = Method.POST;
     request.AddObject(model);
     return await Execute<EmptyObject>(request, m_ManageApi, authToken);
 }
        public async Task<IHttpActionResult> ChangePassword(ChangePasswordBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IdentityResult result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword,
                model.NewPassword);
            
            if (!result.Succeeded)
            {
                return GetErrorResult(result);
            }

            return Ok();
        }
 public async Task<ActionResult> ChangePassword(ChangePasswordBindingModel model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     ApiResponse<EmptyObject> response = await m_UserRepository.ChangePassword(model, GetAuthToken());
     //if (result.Succeeded)
     {
         return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess });
     }
     //AddErrors(result);
     //return View(model);
 }