@cal.macconnachie/web-components 1.2.1 → 1.2.2
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.
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -726,18 +726,18 @@ const Oo = ({
|
|
|
726
726
|
return c.json();
|
|
727
727
|
},
|
|
728
728
|
refresh: async () => {
|
|
729
|
-
const c =
|
|
729
|
+
const c = `${e}${t.refresh}`.replace(/\/api\/api\//, "/api/"), h = await fetch(c, {
|
|
730
730
|
method: "POST",
|
|
731
731
|
headers: {
|
|
732
732
|
"Content-Type": "application/json"
|
|
733
733
|
},
|
|
734
734
|
credentials: "include"
|
|
735
735
|
});
|
|
736
|
-
if (!
|
|
737
|
-
const
|
|
738
|
-
throw new Error(
|
|
736
|
+
if (!h.ok) {
|
|
737
|
+
const m = await h.json();
|
|
738
|
+
throw new Error(m.message || m.error || "Failed to refresh token");
|
|
739
739
|
}
|
|
740
|
-
return
|
|
740
|
+
return h.json();
|
|
741
741
|
},
|
|
742
742
|
checkSession: async () => {
|
|
743
743
|
const c = await fetch(`${e}${t.checkSession}`, {
|
|
@@ -1459,7 +1459,7 @@ let E = class extends U {
|
|
|
1459
1459
|
getApiService() {
|
|
1460
1460
|
return this.apiService || (this.mockMode ? this.apiService = this.createMockApiService() : this.apiService = Oo({
|
|
1461
1461
|
baseUrl: "/api/"
|
|
1462
|
-
})), this.apiService;
|
|
1462
|
+
})), this.error = "", this.apiService;
|
|
1463
1463
|
}
|
|
1464
1464
|
createMockApiService() {
|
|
1465
1465
|
return {
|