@asgardeo/browser 0.1.11 → 0.1.13

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.
@@ -23,7 +23,7 @@ export interface SPAConfig {
23
23
  * @remarks If the consumer app the OP is hosted in different domains,
24
24
  * third party cookies has to be enabled for this to work properly.
25
25
  */
26
- enableOIDCSessionManagement?: boolean;
26
+ syncSession?: boolean;
27
27
  checkSessionInterval?: number;
28
28
  sessionRefreshInterval?: number;
29
29
  resourceServerURLs?: string[];
package/dist/cjs/index.js CHANGED
@@ -1947,6 +1947,7 @@ __export(index_exports, {
1947
1947
  createMediaQueryListener: () => createMediaQueryListener,
1948
1948
  detectThemeMode: () => detectThemeMode,
1949
1949
  hasAuthParamsInUrl: () => hasAuthParamsInUrl_default,
1950
+ http: () => http_default,
1950
1951
  workerReceiver: () => workerReceiver
1951
1952
  });
1952
1953
  module.exports = __toCommonJS(index_exports);
@@ -3003,7 +3004,7 @@ var MainThreadClient = async (instanceID, config, getAuthHelper) => {
3003
3004
  const isCheckSessionIframeDifferent = !(existingConfig && existingConfig.endpoints && existingConfig.endpoints.checkSessionIframe && newConfig && newConfig.endpoints && newConfig.endpoints.checkSessionIframe && existingConfig.endpoints.checkSessionIframe === newConfig.endpoints.checkSessionIframe);
3004
3005
  const config2 = { ...existingConfig, ...newConfig };
3005
3006
  await _authenticationClient.reInitialize(config2);
3006
- if (config2.enableOIDCSessionManagement && isCheckSessionIframeDifferent) {
3007
+ if (config2.syncSession && isCheckSessionIframeDifferent) {
3007
3008
  _sessionManagementHelper.reset();
3008
3009
  checkSession();
3009
3010
  }
@@ -3343,7 +3344,7 @@ var AuthenticationHelper = class {
3343
3344
  this._spaHelper.clearRefreshTokenTimeout();
3344
3345
  this._spaHelper.refreshAccessTokenAutomatically(this);
3345
3346
  }
3346
- if (checkSession && typeof checkSession === "function" && config.enableOIDCSessionManagement) {
3347
+ if (checkSession && typeof checkSession === "function" && config.syncSession) {
3347
3348
  checkSession();
3348
3349
  }
3349
3350
  } else {
@@ -3430,7 +3431,7 @@ var AuthenticationHelper = class {
3430
3431
  if (await this._authenticationClient.isSignedIn()) {
3431
3432
  this._spaHelper.clearRefreshTokenTimeout();
3432
3433
  this._spaHelper.refreshAccessTokenAutomatically(this);
3433
- if (config.enableOIDCSessionManagement) {
3434
+ if (config.syncSession) {
3434
3435
  checkSession();
3435
3436
  }
3436
3437
  return Promise.resolve(await this._authenticationClient.getUser());
@@ -3776,7 +3777,7 @@ var WebWorkerClient = async (instanceID, config, webWorker, getAuthHelper) => {
3776
3777
  };
3777
3778
  return communicate(message2).then((url) => {
3778
3779
  SPAUtils.setSignOutURL(url, config2.clientId, instanceID);
3779
- if (config2.enableOIDCSessionManagement) {
3780
+ if (config2.syncSession) {
3780
3781
  checkSession();
3781
3782
  }
3782
3783
  startAutoRefreshToken();
@@ -3796,7 +3797,7 @@ var WebWorkerClient = async (instanceID, config, webWorker, getAuthHelper) => {
3796
3797
  const tryRetrievingUserInfo = async () => {
3797
3798
  if (await isSignedIn()) {
3798
3799
  await startAutoRefreshToken();
3799
- if (config.enableOIDCSessionManagement) {
3800
+ if (config.syncSession) {
3800
3801
  checkSession();
3801
3802
  }
3802
3803
  return getUser();
@@ -3992,7 +3993,7 @@ var WebWorkerClient = async (instanceID, config, webWorker, getAuthHelper) => {
3992
3993
  type: UPDATE_CONFIG
3993
3994
  };
3994
3995
  await communicate(message);
3995
- if (config2.enableOIDCSessionManagement && isCheckSessionIframeDifferent) {
3996
+ if (config2.syncSession && isCheckSessionIframeDifferent) {
3996
3997
  _sessionManagementHelper.reset();
3997
3998
  checkSession();
3998
3999
  }
@@ -4029,7 +4030,7 @@ var WebWorkerClient = async (instanceID, config, webWorker, getAuthHelper) => {
4029
4030
  var DefaultConfig = {
4030
4031
  autoLogoutOnTokenRefreshError: false,
4031
4032
  checkSessionInterval: 3,
4032
- enableOIDCSessionManagement: false,
4033
+ syncSession: false,
4033
4034
  periodicTokenRefresh: false,
4034
4035
  sessionRefreshInterval: 300,
4035
4036
  storage: "sessionStorage" /* SessionStorage */
@@ -5425,6 +5426,25 @@ var createMediaQueryListener = (callback) => {
5425
5426
  }
5426
5427
  return mediaQuery;
5427
5428
  };
5429
+
5430
+ // src/utils/http.ts
5431
+ var http = {
5432
+ /**
5433
+ * Makes a single HTTP request using the AsgardeoSPAClient instance.
5434
+ *
5435
+ * @param config - The HTTP request configuration object.
5436
+ * @returns A promise resolving to the HTTP response.
5437
+ */
5438
+ request: AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()),
5439
+ /**
5440
+ * Makes multiple HTTP requests in parallel using the AsgardeoSPAClient instance.
5441
+ *
5442
+ * @param configs - An array of HTTP request configuration objects.
5443
+ * @returns A promise resolving to an array of HTTP responses.
5444
+ */
5445
+ requestAll: AsgardeoSPAClient.getInstance().httpRequestAll.bind(AsgardeoSPAClient.getInstance())
5446
+ };
5447
+ var http_default = http;
5428
5448
  /*! Bundled license information:
5429
5449
 
5430
5450
  ieee754/index.js: