@insforge/react 0.2.2 → 0.2.3

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.mjs CHANGED
@@ -665,6 +665,22 @@ function AuthSubmitButton({
665
665
  );
666
666
  }
667
667
  function AuthLink({ text, linkText, href, appearance = {} }) {
668
+ const currentSearch = typeof window !== "undefined" ? window.location.search : "";
669
+ const finalHref = (() => {
670
+ if (!currentSearch) return href;
671
+ try {
672
+ const url = new URL(href, window.location.origin);
673
+ const currentParams = new URLSearchParams(currentSearch);
674
+ currentParams.forEach((value, key) => {
675
+ if (!url.searchParams.has(key)) {
676
+ url.searchParams.set(key, value);
677
+ }
678
+ });
679
+ return url.pathname + url.search;
680
+ } catch {
681
+ return href;
682
+ }
683
+ })();
668
684
  return /* @__PURE__ */ jsxs("p", { className: cn(
669
685
  "text-center text-sm font-normal text-[#828282] leading-6",
670
686
  appearance.containerClassName
@@ -674,7 +690,7 @@ function AuthLink({ text, linkText, href, appearance = {} }) {
674
690
  /* @__PURE__ */ jsx(
675
691
  "a",
676
692
  {
677
- href,
693
+ href: finalHref,
678
694
  className: cn(
679
695
  "text-sm font-medium text-black leading-6",
680
696
  appearance.linkClassName