示例#1
0
        public async Task <ActionResult> ChangePassword(ChangePasswordViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            if (await _userRegistration.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword))
            {
                await _userRegistration.SignInBy(User.Identity.Name);

                return(RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess }));
            }
            return(View(model));
        }