public ActionResult AccountSettings(AccountSettingsViewModel model) { var thisuser = db.Users.First(u => u.Login == User.Identity.Name); if (ModelState.IsValid && Crypto.VerifyHashedPassword(thisuser.Password, model.OldPassword)) { thisuser.Password = Crypto.HashPassword(model.Password); db.SaveChanges(); } return View(); }
public ActionResult AccountSettings() { AccountSettingsViewModel model = new AccountSettingsViewModel(); model.Login = User.Identity.Name; return View(model); }