@asgardeo/javascript 0.10.0 → 0.10.1

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/dist/index.js CHANGED
@@ -847,6 +847,12 @@ var StorageManager = class _StorageManager {
847
847
  async getTemporaryData(userId) {
848
848
  return JSON.parse(await this.store.getData(this.resolveKey("temporary_data" /* TemporaryData */, userId)) ?? null);
849
849
  }
850
+ async getPersistedData(userId) {
851
+ return JSON.parse(await this.store.getData(this.resolveKey("persisted_data" /* PersistedData */, userId)) ?? null);
852
+ }
853
+ async setPersistedData(persistedData, userId) {
854
+ this.setDataInBulk(this.resolveKey("persisted_data" /* PersistedData */, userId), persistedData);
855
+ }
850
856
  async getSessionData(userId, instanceId) {
851
857
  return JSON.parse(await this.store.getData(this.resolveKey("session_data" /* SessionData */, userId, instanceId)) ?? null);
852
858
  }
@@ -1105,9 +1111,21 @@ var _AsgardeoAuthClient = class _AsgardeoAuthClient {
1105
1111
  this.configProvider = async () => this.storageManager.getConfigData();
1106
1112
  this.oidcProviderMetaDataProvider = async () => this.storageManager.loadOpenIDProviderConfiguration();
1107
1113
  _AsgardeoAuthClient.authHelperInstance = this.authHelper;
1114
+ let { applicationId } = config;
1115
+ if (applicationId) {
1116
+ await this.storageManager.setPersistedData({
1117
+ applicationId
1118
+ });
1119
+ } else {
1120
+ const persistedData = await this.storageManager.getPersistedData();
1121
+ if (persistedData["applicationId"]) {
1122
+ applicationId = persistedData["applicationId"];
1123
+ }
1124
+ }
1108
1125
  await this.storageManager.setConfigData({
1109
1126
  ...DefaultConfig,
1110
1127
  ...config,
1128
+ applicationId,
1111
1129
  scope: processOpenIDScopes_default(config.scopes)
1112
1130
  });
1113
1131
  }