@saasquatch/component-environment 1.0.11-1 → 1.0.11

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.js CHANGED
@@ -554,14 +554,12 @@ function _getInitialValue() {
554
554
  };
555
555
  case "SquatchPortal":
556
556
  const searchParams = new URLSearchParams(document.location.search);
557
- const stored = localStorage.getItem(USER_CONTEXT_NAME);
558
- console.log({ stored });
559
- if (searchParams.has("jwt") && !stored) {
557
+ if (searchParams.has("jwt")) {
560
558
  const identity = userIdentityFromJwt(searchParams.get("jwt"));
561
559
  localStorage.setItem(USER_CONTEXT_NAME, JSON.stringify(identity));
562
- console.log({ storedIdentity: identity });
563
560
  return identity;
564
561
  }
562
+ const stored = localStorage.getItem(USER_CONTEXT_NAME);
565
563
  if (!stored)
566
564
  return void 0;
567
565
  try {
@@ -588,7 +586,6 @@ function setUserIdentity(identity) {
588
586
  if (identity && getEnvironmentSDK().type === "SquatchPortal") {
589
587
  localStorage.setItem(USER_CONTEXT_NAME, JSON.stringify(identity));
590
588
  } else if (!identity) {
591
- console.log("removing user identity from local storage");
592
589
  localStorage.removeItem(USER_CONTEXT_NAME);
593
590
  }
594
591
  }
package/dist/index.mjs CHANGED
@@ -505,14 +505,12 @@ function _getInitialValue() {
505
505
  };
506
506
  case "SquatchPortal":
507
507
  const searchParams = new URLSearchParams(document.location.search);
508
- const stored = localStorage.getItem(USER_CONTEXT_NAME);
509
- console.log({ stored });
510
- if (searchParams.has("jwt") && !stored) {
508
+ if (searchParams.has("jwt")) {
511
509
  const identity = userIdentityFromJwt(searchParams.get("jwt"));
512
510
  localStorage.setItem(USER_CONTEXT_NAME, JSON.stringify(identity));
513
- console.log({ storedIdentity: identity });
514
511
  return identity;
515
512
  }
513
+ const stored = localStorage.getItem(USER_CONTEXT_NAME);
516
514
  if (!stored)
517
515
  return void 0;
518
516
  try {
@@ -539,7 +537,6 @@ function setUserIdentity(identity) {
539
537
  if (identity && getEnvironmentSDK().type === "SquatchPortal") {
540
538
  localStorage.setItem(USER_CONTEXT_NAME, JSON.stringify(identity));
541
539
  } else if (!identity) {
542
- console.log("removing user identity from local storage");
543
540
  localStorage.removeItem(USER_CONTEXT_NAME);
544
541
  }
545
542
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasquatch/component-environment",
3
- "version": "1.0.11-1",
3
+ "version": "1.0.11",
4
4
  "description": "Environment and contexts for SaaSquatch components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",