@overmap-ai/core 1.0.65-error-message-fix.3 → 1.0.65-error-message-fix.5

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.
@@ -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",
@@ -4080,22 +4079,18 @@ class JWTService extends BaseAuthService {
4080
4079
  blockers: [],
4081
4080
  blocks: []
4082
4081
  }).then(parseTokens);
4083
- const timeout = 5;
4082
+ const timeout = 10;
4084
4083
  let timedOut = false;
4085
- const timeoutPromise = new Promise((_, reject) => {
4086
- setTimeout(() => {
4087
- timedOut = true;
4088
- this.dispatch(markForDeletion(uuid));
4089
- reject(new APIError({ message: `Request timed out after ${timeout} seconds` }));
4090
- }, timeout * 1e3);
4091
- });
4092
- const successPromise = promise.then((tokens) => {
4093
- if (timedOut) {
4094
- return void 0;
4095
- }
4084
+ setTimeout(() => {
4085
+ timedOut = true;
4086
+ this.dispatch(markForDeletion(uuid));
4087
+ }, timeout * 1e3);
4088
+ void promise.then((tokens) => {
4089
+ if (timedOut)
4090
+ return;
4096
4091
  this.setTokens(tokens);
4097
4092
  });
4098
- return Promise.race([timeoutPromise, successPromise]);
4093
+ return promise;
4099
4094
  }
4100
4095
  }
4101
4096
  class BaseApiService extends BaseService {