conexys-elements 1.1.2 → 1.1.3

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.esm.js CHANGED
@@ -281,7 +281,9 @@ const authStorage = {
281
281
  if (USE_COOKIES_FOR_AUTH) {
282
282
  return this.getCookie('cxauthxc');
283
283
  }
284
- return localStorage.getItem('cxauthxc');
284
+ const local = localStorage.getItem('cxauthxc');
285
+ if (local !== null) return local;
286
+ return this.getCookie('cxauthxc');
285
287
  },
286
288
  setSessionId(sessionId, configLogs) {
287
289
  initializeAuthConfig(configLogs);
@@ -296,7 +298,9 @@ const authStorage = {
296
298
  if (USE_COOKIES_FOR_AUTH) {
297
299
  return this.getCookie('cx_session');
298
300
  }
299
- return localStorage.getItem('cx_session');
301
+ const local = localStorage.getItem('cx_session');
302
+ if (local !== null) return local;
303
+ return this.getCookie('cx_session');
300
304
  },
301
305
  removeAuthData(configLogs) {
302
306
  initializeAuthConfig(configLogs);
@@ -10135,8 +10139,8 @@ const initializeSharedServices = () => {
10135
10139
  },
10136
10140
  getAuthData: () => {
10137
10141
  return {
10138
- sessionID: localStorage.getItem('cx_session'),
10139
- authToken: localStorage.getItem('cxauthxc')
10142
+ sessionID: authStorage.getSessionId(configLogs),
10143
+ authToken: authStorage.getAuthToken(configLogs)
10140
10144
  };
10141
10145
  }
10142
10146
  };