private void AddOrUpdateCurrentUserParam(ActionExecutingContext filterContext, User currentUser) { if (filterContext.ActionParameters.ContainsKey(_bindToVariable)) { filterContext.ActionParameters[_bindToVariable] = currentUser; } else { filterContext.ActionParameters.Add(_bindToVariable, currentUser); } }
private static bool AuthorizeUser(AccountViewModel accountModel, User user) { if (user != null && PasswordHash.ValidatePassword(accountModel.Password, user.Password, user.Salt)) { FormsAuthentication.SetAuthCookie(accountModel.Username, accountModel.Remember); return true; } return false; }