public ActionResult ResetSecret(int id) { var client = _apiClientBusiness.GetApiClient(id); var model = new ChangeSecretModel { ApiClientId = client.ApiClientId, Key = client.Key, Secret = Guid.NewGuid().ToString() }; return(PartialView("_ResetSecret", model)); }
public JsonResult ResetSecret(ChangeSecretModel model) { try { if (model != null && ModelState.IsValid) { _apiClientBusiness.ChangeSecret(WamsUser.WamsId, model.ApiClientId, model.Secret); } return(Json(new { success = true })); } catch (Exception) { return(Json(new { success = false, Errors = string.Format("Could not reset secret") })); } }