@nibssplc/cams-sdk-react 0.0.1-beta.35 → 0.0.1-beta.36

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
@@ -16805,6 +16805,14 @@ function useCAMSMSALAuth(options) {
16805
16805
  setToken(response.accessToken);
16806
16806
  setAccessToken(response.accessToken);
16807
16807
  setIdToken(response.idToken);
16808
+ // Persist tokens to localStorage
16809
+ if (typeof window !== 'undefined') {
16810
+ localStorage.setItem('cams-msal-auth', JSON.stringify({
16811
+ isAuthenticated: true,
16812
+ accessToken: response.accessToken,
16813
+ idToken: response.idToken
16814
+ }));
16815
+ }
16808
16816
  (_a = options.onAuthSuccess) === null || _a === void 0 ? void 0 : _a.call(options, response.accessToken);
16809
16817
  if (typeof window !== "undefined" &&
16810
16818
  process.env.NODE_ENV !== "test") {