@overmap-ai/core 1.0.49-fix-error-messaging.2 → 1.0.49-fix-error-messaging.3

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.
@@ -4322,10 +4322,20 @@ async function performRequest(action, client) {
4322
4322
  innerError: error2
4323
4323
  });
4324
4324
  }
4325
- console.debug("Forbidden; renewing tokens and retrying.");
4326
- await client.auth.renewTokens();
4327
- console.debug("Successfully renewed tokens; retrying request.");
4328
- return requestToSend.query(queryParams);
4325
+ if (state.authReducer.isLoggedIn) {
4326
+ console.debug("Forbidden; renewing tokens and retrying.");
4327
+ await client.auth.renewTokens();
4328
+ console.debug("Successfully renewed tokens; retrying request.");
4329
+ return requestToSend.query(queryParams);
4330
+ } else {
4331
+ console.debug("Forbidden; user is not logged in.");
4332
+ throw new APIError({
4333
+ message: "Incorrect username or password.",
4334
+ response: errorResponse,
4335
+ discard: true,
4336
+ innerError: error2
4337
+ });
4338
+ }
4329
4339
  }
4330
4340
  throw new APIError({ response: errorResponse, innerError: error2, discard: discardStatuses.includes(status) });
4331
4341
  }
@@ -5147,6 +5157,7 @@ class AuthService extends BaseApiService {
5147
5157
  url: "/api/token/",
5148
5158
  payload: credentials,
5149
5159
  isAuthNeeded: false,
5160
+ checkAuth: false,
5150
5161
  blockers: [],
5151
5162
  blocks: []
5152
5163
  }).then(parseTokens).catch((e) => {