Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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")
         }));
     }
 }