@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.esm.js CHANGED
@@ -1216,7 +1216,7 @@ function CAMSMSALProviderInner(_a) {
1216
1216
  localStorage.setItem(auth.storageKey, JSON.stringify({
1217
1217
  accessToken: auth.accessToken,
1218
1218
  idToken: auth.idToken,
1219
- appCode: auth.appCode
1219
+ appCode: auth.appCode,
1220
1220
  }));
1221
1221
  }
1222
1222
  }, [auth.accessToken, auth.idToken, auth.storageKey]);
@@ -1251,7 +1251,9 @@ function CAMSMSALProviderInner(_a) {
1251
1251
  }
1252
1252
  function CAMSMSALProvider(props) {
1253
1253
  var msalConfig = props.msalConfig, msalInstance = props.msalInstance;
1254
- var instance = msalInstance || new PublicClientApplication(msalConfig);
1254
+ var instance = typeof window !== "undefined"
1255
+ ? msalInstance || new PublicClientApplication(msalConfig)
1256
+ : null;
1255
1257
  return (jsxRuntimeExports.jsx(MsalProvider, { instance: instance, children: jsxRuntimeExports.jsx(CAMSMSALProviderInner, __assign({}, props)) }));
1256
1258
  }
1257
1259
  function useCAMSMSALContext() {
@@ -1385,7 +1387,9 @@ function UnifiedCAMSProvider(props) {
1385
1387
  }
1386
1388
  if (props.mode === "MSAL") {
1387
1389
  var msalConfig = props.msalConfig, msalInstance = props.msalInstance;
1388
- var instance = msalInstance || new PublicClientApplication(msalConfig);
1390
+ var instance = typeof window !== "undefined"
1391
+ ? msalInstance || new PublicClientApplication(msalConfig)
1392
+ : null;
1389
1393
  return (jsxRuntimeExports.jsx(MsalProvider, { instance: instance, children: jsxRuntimeExports.jsx(CAMSProviderCore, __assign({}, props)) }));
1390
1394
  }
1391
1395
  return (jsxRuntimeExports.jsx(ClientOnly, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(CAMSProviderCore, __assign({}, props)) }));