public ActionResult SetPassword(ResetPasswordViewModel model) { if (ModelState.IsValid) { Login login = _dataService.GetLoginById(model.LoginId); string salt = SimpleHash.GetSalt(32); login.Password = SimpleHash.MD5(model.NewPassword, salt); login.PasswordSalt = salt; _dataService.UpdateLogin(login); return RedirectToAction("Details", new { id = login.Id }); } return View("SetPassword", model); }
public ActionResult SetPassword(int id) { Login login = _dataService.GetLoginById(id); ResetPasswordViewModel model = new ResetPasswordViewModel() { LoginId = id }; return View("SetPassword", model); }