@nibssplc/cams-sdk-react 0.0.1-beta.40 → 0.0.1-beta.41

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
@@ -17319,7 +17319,7 @@ function ProtectedRoute(_a) {
17319
17319
  var CAMSMSALContext = createContext(null);
17320
17320
  var setCookie = function (name, value, days) {
17321
17321
  var expires = new Date(Date.now() + days * 864e5).toUTCString();
17322
- document.cookie = "".concat(name, "=").concat(encodeURIComponent(value), "; httpOnly; expires=").concat(expires, "; path=/; samesite=Lax");
17322
+ document.cookie = "".concat(name, "=").concat(encodeURIComponent(value), "; expires=").concat(expires, "; path=/; samesite=Lax");
17323
17323
  };
17324
17324
  var getCookie = function (name) {
17325
17325
  var _a;
@@ -17348,12 +17348,13 @@ function CAMSMSALProviderInner(_a) {
17348
17348
  var _this = this;
17349
17349
  var children = _a.children, authOptions = __rest(_a, ["children"]);
17350
17350
  var auth = useCAMSMSALAuth(authOptions);
17351
+ var profileStorageKey = "".concat(auth.storageKey, "-PROFILE");
17351
17352
  var getInitialProfile = function () {
17352
17353
  if (typeof window === "undefined") {
17353
17354
  return null;
17354
17355
  }
17355
17356
  try {
17356
- var storedProfile = localStorage.getItem(profileStorageKey);
17357
+ var storedProfile = getCookie(profileStorageKey);
17357
17358
  return storedProfile ? JSON.parse(storedProfile) : null;
17358
17359
  }
17359
17360
  catch (_a) {
@@ -17361,7 +17362,6 @@ function CAMSMSALProviderInner(_a) {
17361
17362
  }
17362
17363
  };
17363
17364
  var _b = useState(getInitialProfile), userProfile = _b[0], setUserProfile = _b[1];
17364
- var profileStorageKey = "".concat(auth.storageKey, "-PROFILE");
17365
17365
  // Load profile from storage on mount
17366
17366
  useEffect(function () {
17367
17367
  if (typeof window !== "undefined") {