@opengeoweb/api 4.13.1 → 4.15.0

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/index.esm.js CHANGED
@@ -323,7 +323,8 @@ var makeCredentialsFromTokenResponse = function makeCredentialsFromTokenResponse
323
323
  token: access_token,
324
324
  refresh_token: refresh_token || '',
325
325
  expires_at: epochTimeTokenExpirationInSeconds,
326
- keep_session_alive_at: getCurrentTimeInSeconds() + KEEP_ALIVE_IN_SECONDS
326
+ keep_session_alive_at: getCurrentTimeInSeconds() + KEEP_ALIVE_IN_SECONDS,
327
+ has_connection_issue: false
327
328
  };
328
329
  return newAuth;
329
330
  };
@@ -382,40 +383,29 @@ var refreshAccessTokenAndSetAuthContext = function refreshAccessTokenAndSetAuthC
382
383
 
383
384
  case 3:
384
385
  refreshedToken = _context.sent;
385
- newAuth = makeCredentialsFromTokenResponse(refreshedToken);
386
- /*
387
- Note: Should not use the spread operator here on the auth object to create a new object.
388
- Creating a new object and setting that via onSetAuth might change the auth object too late.
389
- Instead assign the new token directly to the property and then use the onSetAuth.
390
- */
391
- // eslint-disable-next-line no-param-reassign
386
+ newAuth = makeCredentialsFromTokenResponse(refreshedToken); // Cognito does not send a new refresh token, but gitlab does. Set it here into the auth context.
392
387
 
393
- auth.token = newAuth.token; // eslint-disable-next-line no-param-reassign
388
+ if (!newAuth.refresh_token || newAuth.refresh_token.length === 0) {
389
+ newAuth.refresh_token = auth.refresh_token;
390
+ }
394
391
 
395
- auth.expires_at = newAuth.expires_at; // eslint-disable-next-line no-param-reassign
396
-
397
- auth.refresh_token = newAuth.refresh_token || auth.refresh_token; // eslint-disable-next-line no-param-reassign
398
-
399
- auth.keep_session_alive_at = newAuth.keep_session_alive_at;
400
- onSetAuth(Object.assign(Object.assign({}, auth), {
401
- has_connection_issue: false
402
- }));
403
- _context.next = 15;
392
+ onSetAuth(newAuth);
393
+ _context.next = 12;
404
394
  break;
405
395
 
406
- case 12:
407
- _context.prev = 12;
396
+ case 9:
397
+ _context.prev = 9;
408
398
  _context.t0 = _context["catch"](0);
409
399
  onSetAuth(Object.assign(Object.assign({}, auth), {
410
400
  has_connection_issue: true
411
401
  }));
412
402
 
413
- case 15:
403
+ case 12:
414
404
  case "end":
415
405
  return _context.stop();
416
406
  }
417
407
  }
418
- }, _callee, null, [[0, 12]]);
408
+ }, _callee, null, [[0, 9]]);
419
409
  }));
420
410
  };
421
411
  var createApiInstance = function createApiInstance(_ref3) {
package/index.umd.js CHANGED
@@ -350,7 +350,8 @@
350
350
  token: access_token,
351
351
  refresh_token: refresh_token || '',
352
352
  expires_at: epochTimeTokenExpirationInSeconds,
353
- keep_session_alive_at: getCurrentTimeInSeconds() + KEEP_ALIVE_IN_SECONDS
353
+ keep_session_alive_at: getCurrentTimeInSeconds() + KEEP_ALIVE_IN_SECONDS,
354
+ has_connection_issue: false
354
355
  };
355
356
  return newAuth;
356
357
  };
@@ -411,24 +412,13 @@
411
412
 
412
413
  case 1:
413
414
  refreshedToken = _c.sent();
414
- newAuth = makeCredentialsFromTokenResponse(refreshedToken);
415
- /*
416
- Note: Should not use the spread operator here on the auth object to create a new object.
417
- Creating a new object and setting that via onSetAuth might change the auth object too late.
418
- Instead assign the new token directly to the property and then use the onSetAuth.
419
- */
420
- // eslint-disable-next-line no-param-reassign
415
+ newAuth = makeCredentialsFromTokenResponse(refreshedToken); // Cognito does not send a new refresh token, but gitlab does. Set it here into the auth context.
421
416
 
422
- auth.token = newAuth.token; // eslint-disable-next-line no-param-reassign
417
+ if (!newAuth.refresh_token || newAuth.refresh_token.length === 0) {
418
+ newAuth.refresh_token = auth.refresh_token;
419
+ }
423
420
 
424
- auth.expires_at = newAuth.expires_at; // eslint-disable-next-line no-param-reassign
425
-
426
- auth.refresh_token = newAuth.refresh_token || auth.refresh_token; // eslint-disable-next-line no-param-reassign
427
-
428
- auth.keep_session_alive_at = newAuth.keep_session_alive_at;
429
- onSetAuth(__assign(__assign({}, auth), {
430
- has_connection_issue: false
431
- }));
421
+ onSetAuth(newAuth);
432
422
  return [3
433
423
  /*break*/
434
424
  , 3];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/api",
3
- "version": "4.13.1",
3
+ "version": "4.15.0",
4
4
  "description": "GeoWeb API library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,18 +14,13 @@
14
14
  "peerDependencies": {
15
15
  "react": "^18.2.0",
16
16
  "axios": "^0.25.0",
17
- "@opengeoweb/shared": "4.13.1",
17
+ "@opengeoweb/shared": "4.15.0",
18
18
  "@mui/material": "^5.10.8",
19
- "@opengeoweb/theme": "4.13.1",
19
+ "@opengeoweb/theme": "4.15.0",
20
20
  "react-draggable": "^4.4.5",
21
21
  "re-resizable": "^6.9.0",
22
22
  "@redux-eggs/core": "^2.2.0",
23
23
  "react-redux": "^8.0.4",
24
- "@opengeoweb/form-fields": "4.13.1",
25
- "react-hook-form": "^7.41.5",
26
- "moment": "^2.29.0",
27
- "moment-timezone": "^0.5.31",
28
- "@mui/x-date-pickers": "^5.0.4",
29
24
  "lodash": "^4.17.20",
30
25
  "date-fns": "^2.29.3"
31
26
  }