@overmap-ai/core 1.0.65-error-message-fix.2 → 1.0.65-error-message-fix.4
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/overmap-core.js
CHANGED
|
@@ -241,9 +241,9 @@ function extractErrorMessage(errorRes, err) {
|
|
|
241
241
|
} else if (typeof responseBody.message === "string") {
|
|
242
242
|
console.debug("body.message is string", responseBody.message);
|
|
243
243
|
ret = responseBody.message;
|
|
244
|
-
} else
|
|
244
|
+
} else {
|
|
245
245
|
try {
|
|
246
|
-
ret = Object.entries(responseBody
|
|
246
|
+
ret = Object.entries(responseBody).map(([key, value]) => {
|
|
247
247
|
if (typeof value === "string") {
|
|
248
248
|
if (_SPECIAL_KEYS.includes(key))
|
|
249
249
|
return value;
|
|
@@ -4068,7 +4068,6 @@ class JWTService extends BaseAuthService {
|
|
|
4068
4068
|
}
|
|
4069
4069
|
async initAuth(payload) {
|
|
4070
4070
|
const uuid = v4();
|
|
4071
|
-
console.debug(this.constructor.name, "Initiating auth");
|
|
4072
4071
|
const promise = this.enqueueRequest({
|
|
4073
4072
|
uuid,
|
|
4074
4073
|
description: "Get token pair",
|
|
@@ -4079,23 +4078,19 @@ class JWTService extends BaseAuthService {
|
|
|
4079
4078
|
checkAuth: false,
|
|
4080
4079
|
blockers: [],
|
|
4081
4080
|
blocks: []
|
|
4082
|
-
})
|
|
4083
|
-
const timeout =
|
|
4081
|
+
});
|
|
4082
|
+
const timeout = 10;
|
|
4084
4083
|
let timedOut = false;
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
}, timeout * 1e3);
|
|
4091
|
-
});
|
|
4092
|
-
const successPromise = promise.then((tokens) => {
|
|
4084
|
+
setTimeout(() => {
|
|
4085
|
+
timedOut = true;
|
|
4086
|
+
this.dispatch(markForDeletion(uuid));
|
|
4087
|
+
}, timeout * 1e3);
|
|
4088
|
+
return promise.then((tokens) => {
|
|
4093
4089
|
if (timedOut) {
|
|
4094
4090
|
return void 0;
|
|
4095
4091
|
}
|
|
4096
|
-
this.setTokens(tokens);
|
|
4092
|
+
this.setTokens(parseTokens(tokens));
|
|
4097
4093
|
});
|
|
4098
|
-
return Promise.race([timeoutPromise, successPromise]);
|
|
4099
4094
|
}
|
|
4100
4095
|
}
|
|
4101
4096
|
class BaseApiService extends BaseService {
|