public void UpdatePassword(ChangePasswordViewModel vm) { var user = _dbContext.Users.FirstOrDefault(x => x.Token == vm.Token); if (user != null) { user.Password = vm.Password; user.Token = null; } }
public ActionResult ChangePassword(ChangePasswordViewModel vm) { _unitOfWork.Users.UpdatePassword(vm); _unitOfWork.Complete(); return(View("Index")); }