@zerosls/clm-sdk 2.1.0 → 2.1.1
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/core/api-client.js
CHANGED
|
@@ -93,14 +93,6 @@ export class ApiClient {
|
|
|
93
93
|
method,
|
|
94
94
|
data,
|
|
95
95
|
});
|
|
96
|
-
// Colocado
|
|
97
|
-
if (this.debug) {
|
|
98
|
-
console.log("🍪 Cookies Debug:", {
|
|
99
|
-
credentials: this.credentials,
|
|
100
|
-
documentCookie: typeof document !== "undefined" ? document.cookie : "N/A",
|
|
101
|
-
url: url,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
96
|
try {
|
|
105
97
|
const fetchOptions = {
|
|
106
98
|
method,
|
|
@@ -112,18 +104,7 @@ export class ApiClient {
|
|
|
112
104
|
console.log(`📤 ${method} Body:`, data);
|
|
113
105
|
}
|
|
114
106
|
console.log(`🌐 ${method} ${url}`, fetchOptions);
|
|
115
|
-
// Colocado
|
|
116
|
-
console.log(`🌐 ${method} ${url}`, {
|
|
117
|
-
...fetchOptions,
|
|
118
|
-
cookieHeader: headers.get("Cookie"),
|
|
119
|
-
});
|
|
120
107
|
const response = await fetch(url, fetchOptions);
|
|
121
|
-
// Colocado
|
|
122
|
-
if (this.debug) {
|
|
123
|
-
console.log("📥 Response Headers:", {
|
|
124
|
-
setCookie: response.headers.get("Set-Cookie"),
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
108
|
if (!response.ok) {
|
|
128
109
|
let errorData;
|
|
129
110
|
try {
|
|
@@ -61,13 +61,15 @@ export class AuthApi {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
isAuthenticated() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
//isAuthenticated(): boolean {
|
|
65
|
+
// const hasToken = this.apiClient.getToken() !== null;
|
|
66
|
+
// const hasLegacy =
|
|
67
|
+
// (typeof sessionStorage !== "undefined" &&
|
|
68
|
+
// !!sessionStorage.getItem("legacy_token")) ||
|
|
69
|
+
// (typeof window !== "undefined" && !!(window as any).__LEGACY_TOKEN__);
|
|
70
|
+
//
|
|
71
|
+
// return hasToken || hasLegacy;
|
|
72
|
+
//}
|
|
71
73
|
setToken(token) {
|
|
72
74
|
this.apiClient.setToken(token);
|
|
73
75
|
}
|
package/package.json
CHANGED
package/src/core/api-client.ts
CHANGED
|
@@ -176,16 +176,6 @@ export class ApiClient {
|
|
|
176
176
|
data,
|
|
177
177
|
});
|
|
178
178
|
|
|
179
|
-
// Colocado
|
|
180
|
-
if (this.debug) {
|
|
181
|
-
console.log("🍪 Cookies Debug:", {
|
|
182
|
-
credentials: this.credentials,
|
|
183
|
-
documentCookie:
|
|
184
|
-
typeof document !== "undefined" ? document.cookie : "N/A",
|
|
185
|
-
url: url,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
179
|
try {
|
|
190
180
|
const fetchOptions: RequestInit = {
|
|
191
181
|
method,
|
|
@@ -200,21 +190,8 @@ export class ApiClient {
|
|
|
200
190
|
|
|
201
191
|
console.log(`🌐 ${method} ${url}`, fetchOptions);
|
|
202
192
|
|
|
203
|
-
// Colocado
|
|
204
|
-
console.log(`🌐 ${method} ${url}`, {
|
|
205
|
-
...fetchOptions,
|
|
206
|
-
cookieHeader: headers.get("Cookie"),
|
|
207
|
-
});
|
|
208
|
-
|
|
209
193
|
const response = await fetch(url, fetchOptions);
|
|
210
194
|
|
|
211
|
-
// Colocado
|
|
212
|
-
if (this.debug) {
|
|
213
|
-
console.log("📥 Response Headers:", {
|
|
214
|
-
setCookie: response.headers.get("Set-Cookie"),
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
195
|
if (!response.ok) {
|
|
219
196
|
let errorData;
|
|
220
197
|
try {
|
|
@@ -83,15 +83,15 @@ export class AuthApi {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
isAuthenticated(): boolean {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
86
|
+
//isAuthenticated(): boolean {
|
|
87
|
+
// const hasToken = this.apiClient.getToken() !== null;
|
|
88
|
+
// const hasLegacy =
|
|
89
|
+
// (typeof sessionStorage !== "undefined" &&
|
|
90
|
+
// !!sessionStorage.getItem("legacy_token")) ||
|
|
91
|
+
// (typeof window !== "undefined" && !!(window as any).__LEGACY_TOKEN__);
|
|
92
|
+
//
|
|
93
|
+
// return hasToken || hasLegacy;
|
|
94
|
+
//}
|
|
95
95
|
|
|
96
96
|
setToken(token: string | null): void {
|
|
97
97
|
this.apiClient.setToken(token);
|