acsi-core 0.9.27 → 0.9.28

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
@@ -2743,15 +2743,32 @@ var BlockLogin = function BlockLogin(_ref) {
2743
2743
  role: role,
2744
2744
  type: TypeLogin.Microsoft
2745
2745
  };
2746
+ console.log('[MSAL] BlockLogin: processMSALLogin - Calling apiLoginGoogle...');
2746
2747
  return Promise.resolve(apiLoginGoogle(infoLogin)).then(function (authResult) {
2747
- var _authResult$data;
2748
- if (((_authResult$data = authResult.data) === null || _authResult$data === void 0 ? void 0 : _authResult$data.id) == null) {
2748
+ var _authResult$data, _authResult$data2;
2749
+ console.log('[MSAL] BlockLogin: processMSALLogin - apiLoginGoogle response:', {
2750
+ hasData: !!authResult.data,
2751
+ userId: (_authResult$data = authResult.data) === null || _authResult$data === void 0 ? void 0 : _authResult$data.id
2752
+ });
2753
+ if (((_authResult$data2 = authResult.data) === null || _authResult$data2 === void 0 ? void 0 : _authResult$data2.id) == null) {
2749
2754
  dispatch(setLoading(false));
2755
+ console.error('[MSAL] BlockLogin: processMSALLogin - Login failed, no user ID');
2750
2756
  alert("Please contact admin.");
2751
2757
  return;
2752
2758
  }
2759
+ var msalCacheKeys = Object.keys(localStorage).filter(function (key) {
2760
+ return key.startsWith('msal.');
2761
+ });
2762
+ var msalCache = {};
2763
+ msalCacheKeys.forEach(function (key) {
2764
+ msalCache[key] = localStorage.getItem(key) || '';
2765
+ });
2753
2766
  localStorage.clear();
2767
+ Object.keys(msalCache).forEach(function (key) {
2768
+ localStorage.setItem(key, msalCache[key]);
2769
+ });
2754
2770
  var tokenJWT = authResult.data.token;
2771
+ console.log('[MSAL] BlockLogin: processMSALLogin - Got JWT token');
2755
2772
  trackEvent === null || trackEvent === void 0 ? void 0 : trackEvent({
2756
2773
  eventName: exports.AmplitudeEvent.LOGIN,
2757
2774
  eventProperties: {
@@ -2911,8 +2928,8 @@ var BlockLogin = function BlockLogin(_ref) {
2911
2928
  };
2912
2929
  dispatch(setLoading(true));
2913
2930
  return Promise.resolve(apiLoginGoogle(infoLogin)).then(function (authResult) {
2914
- var _authResult$data2;
2915
- if (((_authResult$data2 = authResult.data) === null || _authResult$data2 === void 0 ? void 0 : _authResult$data2.id) == null) {
2931
+ var _authResult$data3;
2932
+ if (((_authResult$data3 = authResult.data) === null || _authResult$data3 === void 0 ? void 0 : _authResult$data3.id) == null) {
2916
2933
  dispatch(setLoading(false));
2917
2934
  alert("Please contact admin.");
2918
2935
  return;