@overmap-ai/core 1.0.60-sdk-refactor.13 → 1.0.60-sdk-refactor.15
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
|
@@ -15082,7 +15082,6 @@ function extractResponseFromError(error2) {
|
|
|
15082
15082
|
}
|
|
15083
15083
|
async function performRequest(action, client) {
|
|
15084
15084
|
const serviceOfRequest = CLASS_NAME_TO_SERVICE[action.meta.offline.effect.serviceName];
|
|
15085
|
-
console.debug(CLASS_NAME_TO_SERVICE, action.meta.offline.effect.serviceName, serviceOfRequest);
|
|
15086
15085
|
if (!serviceOfRequest) {
|
|
15087
15086
|
throw new Error(`Service ${action.meta.offline.effect.serviceName} not found`);
|
|
15088
15087
|
}
|
|
@@ -15463,19 +15462,15 @@ class JWTService extends BaseAuthService {
|
|
|
15463
15462
|
checkAuth: false,
|
|
15464
15463
|
// Don't wait for other requests to finish, or we might end up in a deadlock.
|
|
15465
15464
|
immediate: true
|
|
15466
|
-
}).catch((e) => {
|
|
15467
|
-
console.error("Could not renew tokens; logging out due to error:", e);
|
|
15468
|
-
this.clearAuth();
|
|
15469
|
-
return void 0;
|
|
15470
15465
|
});
|
|
15471
15466
|
let response = void 0;
|
|
15472
15467
|
try {
|
|
15473
15468
|
response = await promise;
|
|
15474
15469
|
} catch (e) {
|
|
15470
|
+
console.error("Could not renew tokens; clearing auth", e);
|
|
15475
15471
|
this.clearAuth();
|
|
15476
|
-
}
|
|
15477
|
-
if (!response)
|
|
15478
15472
|
return void 0;
|
|
15473
|
+
}
|
|
15479
15474
|
if (!response.access)
|
|
15480
15475
|
throw new Error("Missing access token");
|
|
15481
15476
|
if (!response.refresh)
|
|
@@ -15493,6 +15488,7 @@ class JWTService extends BaseAuthService {
|
|
|
15493
15488
|
this.dispatch(setActiveWorkspaceId(null));
|
|
15494
15489
|
this.dispatch({ type: RESET_STATE });
|
|
15495
15490
|
this.dispatch({ type: resetStore });
|
|
15491
|
+
console.debug(this.constructor.name, "clearing auth;");
|
|
15496
15492
|
}
|
|
15497
15493
|
/**
|
|
15498
15494
|
* Attempts to renew tokens
|
|
@@ -15510,15 +15506,11 @@ class JWTService extends BaseAuthService {
|
|
|
15510
15506
|
console.log("Got renewed tokens");
|
|
15511
15507
|
this.setTokens(tokens);
|
|
15512
15508
|
} catch (e) {
|
|
15513
|
-
console.error("Could not renew tokens;
|
|
15509
|
+
console.error("Could not renew tokens; clearing auth", e);
|
|
15514
15510
|
this.clearAuth();
|
|
15515
15511
|
throw e;
|
|
15516
15512
|
}
|
|
15517
15513
|
}
|
|
15518
|
-
/**
|
|
15519
|
-
* Checks whether the tokens will be expiring soon
|
|
15520
|
-
* @returns {boolean}
|
|
15521
|
-
*/
|
|
15522
15514
|
tokenIsExpiringSoon() {
|
|
15523
15515
|
const accessToken = this.getAccessToken();
|
|
15524
15516
|
if (!accessToken) {
|
|
@@ -15535,8 +15527,9 @@ class JWTService extends BaseAuthService {
|
|
|
15535
15527
|
return secondsUntilExpiry < EXPIRING_SOON_THRESHOLD;
|
|
15536
15528
|
}
|
|
15537
15529
|
getAuthHeader() {
|
|
15538
|
-
const
|
|
15539
|
-
|
|
15530
|
+
const accessToken = this.getAccessToken();
|
|
15531
|
+
console.debug("getAuthHeader", accessToken);
|
|
15532
|
+
return `Bearer ${accessToken}`;
|
|
15540
15533
|
}
|
|
15541
15534
|
async prepareAuth() {
|
|
15542
15535
|
if (!this.tokenIsExpiringSoon())
|