Jake Vanderwerf
2026-07-05 fff721dd185f5b97f7ae7a6e64189e55887ff590
assets/js/concise/AuthManager.js
@@ -50,6 +50,7 @@
      }
   }
   /**
    * Refresh nonce if authentication fails
    */
@@ -77,11 +78,22 @@
            'X-WP-Nonce': this.getNonce()
         };
         const response = await fetch(url, {
         if (!isFormData && typeof options.body === 'object' && !Object.hasOwn(options.body, 'user')) {
            options.body.user = this.getUser();
         }
         let obj = {
            ...options,
            credentials: 'same-origin',
            headers
         });
         };
         if (!isFormData && typeof obj.body === 'object') {
            obj.body = JSON.stringify(obj.body);
         }
         const response = await fetch(url, obj);
         if ((response.status === 403 || response.status === 401) && retryCount === 0) {
            const result = await response.clone().json();
@@ -231,6 +243,21 @@
      });
   }
   getHeader(action) {
      switch (action) {
         case 'dash':
            return {
               'X-Action-Nonce': this.getNonce('dash')
            };
         case 'default':
            return {
               'X-WP-Nonce': this.getNonce()
            };
         default:
            return {};
      }
   }
}
// Initialize global instance