@redneckz/wildless-cms-uni-blocks 0.14.654 → 0.14.655

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.
@@ -6789,7 +6789,7 @@
6789
6789
  globalThis.location.href = PORTAL_NATURAL_URL;
6790
6790
  return () => null;
6791
6791
  }
6792
- const timer = setInterval(async () => {
6792
+ const updateTokenRequest = async () => {
6793
6793
  const res = await doRequest('/auth/refresh', 'POST', {
6794
6794
  // eslint-disable-next-line camelcase
6795
6795
  refresh_token: refreshToken,
@@ -6797,14 +6797,21 @@
6797
6797
  access_token: accessToken,
6798
6798
  });
6799
6799
  if (res instanceof Response) {
6800
- globalThis.location.href = PORTAL_NATURAL_URL;
6800
+ handleStatus(res.status);
6801
6801
  return;
6802
6802
  }
6803
- sessionStorage.setItem('refreshToken', res.refresh_token);
6804
- sessionStorage.setItem('accessToken', res.access_token);
6805
- }, UPDATING_INTERVAL);
6803
+ globalThis.sessionStorage.setItem('refreshToken', res.refresh_token);
6804
+ globalThis.sessionStorage.setItem('accessToken', res.access_token);
6805
+ };
6806
+ updateTokenRequest();
6807
+ const timer = setInterval(updateTokenRequest, UPDATING_INTERVAL);
6806
6808
  return () => clearInterval(timer);
6807
6809
  };
6810
+ const handleStatus = (status) => {
6811
+ if (status == 401) {
6812
+ globalThis.location.href = PORTAL_NATURAL_URL;
6813
+ }
6814
+ };
6808
6815
 
6809
6816
  const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
6810
6817
  const progress = useMemo(() => (step / totalSteps) * 100, [step, totalSteps]);
@@ -9820,7 +9827,7 @@
9820
9827
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
9821
9828
  });
9822
9829
 
9823
- const packageVersion = "0.14.653";
9830
+ const packageVersion = "0.14.654";
9824
9831
 
9825
9832
  exports.Blocks = Blocks;
9826
9833
  exports.ContentPage = ContentPage;