INNER CODE UNIT · JavaScript

loadAuthenticatedConfig

giuseppe99barchetta/SuggestArr · client/src/router/index.js:68

async function loadAuthenticatedConfig() {
  if (_authConfigPromise) return _authConfigPromise;

  _authConfigPromise = axios
    .get("/api/config/fetch", {
      timeout: 10000,
      // NOTE: NO _skipAuth - the request interceptor WILL add Authorization header
    })
    .then((response) => {
      localStorage.setItem("suggestarr_config", JSON.stringify(response.data));
      return response.data.SUBPATH || "";
    })
    .catch((error) => {
      console.warn(
        "Failed to load authenticated configuration:",
        error.message,
      );
      return ""; // Fallback to root subpath

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…