Exemplo n.º 1
0
        public ActionResult Index(bool newToken = false)
        {
            if (newToken)
            {
                // Create new token
                this._settingsRepo.saveToken(SiteimproveHelper.RequestToken());
            }

            return(View(SiteimproveHelper.GetAdminViewPath("Index"), this._settingsRepo.getToken() as object));
        }
        public string getToken()
        {
            var settings = SettingStore.LoadAll <Settings>().ToArray().FirstOrDefault();

            if (settings == null || string.IsNullOrWhiteSpace(settings.Token))
            {
                string token = SiteimproveHelper.RequestToken();
                saveToken(token);

                return(token);
            }

            return(settings.Token);
        }