@luizleon/sf.prefeiturasp.vuecomponents 4.1.14 → 4.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8825,14 +8825,15 @@ class Fh {
8825
8825
  je(this, "axios");
8826
8826
  this.axios = ae.create(e == null ? void 0 : e.config);
8827
8827
  const n = window.location.origin + "/api";
8828
- this.axios.defaults.baseURL || (this.axios.defaults.baseURL = n), e != null && e.anonymous || this.axios.interceptors.request.use(async (r) => {
8829
- if (!Ih(r.baseURL + r.url))
8830
- return r;
8831
- const o = ep().oidc;
8832
- await o.updateToken(10);
8833
- const i = o.token;
8834
- return i ? r.headers.Authorization = `Bearer ${i}` : o.login(), r;
8835
- });
8828
+ this.axios.defaults.baseURL || (this.axios.defaults.baseURL = n), e != null && e.anonymous || this.axios.interceptors.request.use(async (r) => await this.AccessTokenInterceptor(r));
8829
+ }
8830
+ async AccessTokenInterceptor(e) {
8831
+ if (!Ih(e.baseURL + e.url))
8832
+ return e;
8833
+ const n = ep().oidc;
8834
+ await n.updateToken(10);
8835
+ const r = n.token;
8836
+ return r ? e.headers.Authorization = `Bearer ${r}` : n.login(), e;
8836
8837
  }
8837
8838
  async GetAsync(e) {
8838
8839
  return this.axios.get(e).then((n) => this.HandleThen(n)).catch((n) => this.HandleCatch(n));
@@ -8867,8 +8868,8 @@ class Fh {
8867
8868
  }
8868
8869
  ParsedResponse(e) {
8869
8870
  try {
8870
- const n = typeof e.hasSuccess == "boolean", r = typeof e.hasError == "boolean", o = typeof e.httpStatusCode == "number", i = Array.isArray(e.errors);
8871
- return n && r && o && i ? e : null;
8871
+ const n = typeof e.hasSuccess == "boolean", r = typeof e.hasError == "boolean", o = Array.isArray(e.errors);
8872
+ return n && r && o ? e : null;
8872
8873
  } catch {
8873
8874
  return null;
8874
8875
  }