@overmap-ai/core 1.0.65-error-message-fix.3 → 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.
@@ -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
- }).then(parseTokens);
4083
- const timeout = 5;
4081
+ });
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) => {
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 {