@nibssplc/cams-sdk-react 1.0.0-rc.12 → 1.0.0-rc.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.
package/dist/index.cjs.js CHANGED
@@ -1237,7 +1237,7 @@ function CAMSMSALProviderInner(_a) {
1237
1237
  localStorage.setItem(auth.storageKey, JSON.stringify({
1238
1238
  accessToken: auth.accessToken,
1239
1239
  idToken: auth.idToken,
1240
- appCode: auth.appCode
1240
+ appCode: auth.appCode,
1241
1241
  }));
1242
1242
  }
1243
1243
  }, [auth.accessToken, auth.idToken, auth.storageKey]);
@@ -1272,7 +1272,9 @@ function CAMSMSALProviderInner(_a) {
1272
1272
  }
1273
1273
  function CAMSMSALProvider(props) {
1274
1274
  var msalConfig = props.msalConfig, msalInstance = props.msalInstance;
1275
- var instance = msalInstance || new msalBrowser.PublicClientApplication(msalConfig);
1275
+ var instance = typeof window !== "undefined"
1276
+ ? msalInstance || new msalBrowser.PublicClientApplication(msalConfig)
1277
+ : null;
1276
1278
  return (jsxRuntimeExports.jsx(msalReact.MsalProvider, { instance: instance, children: jsxRuntimeExports.jsx(CAMSMSALProviderInner, __assign({}, props)) }));
1277
1279
  }
1278
1280
  function useCAMSMSALContext() {
@@ -1406,7 +1408,9 @@ function UnifiedCAMSProvider(props) {
1406
1408
  }
1407
1409
  if (props.mode === "MSAL") {
1408
1410
  var msalConfig = props.msalConfig, msalInstance = props.msalInstance;
1409
- var instance = msalInstance || new msalBrowser.PublicClientApplication(msalConfig);
1411
+ var instance = typeof window !== "undefined"
1412
+ ? msalInstance || new msalBrowser.PublicClientApplication(msalConfig)
1413
+ : null;
1410
1414
  return (jsxRuntimeExports.jsx(msalReact.MsalProvider, { instance: instance, children: jsxRuntimeExports.jsx(CAMSProviderCore, __assign({}, props)) }));
1411
1415
  }
1412
1416
  return (jsxRuntimeExports.jsx(ClientOnly, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(CAMSProviderCore, __assign({}, props)) }));