@orangecheck/auth-client 2.14.0 → 2.14.1

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
@@ -1885,6 +1885,11 @@ function ProviderSignIn({
1885
1885
  authOrigin,
1886
1886
  returnTo
1887
1887
  }) {
1888
+ const [origin, setOrigin] = React3.useState("");
1889
+ React3.useEffect(() => {
1890
+ setOrigin(window.location.origin);
1891
+ }, []);
1892
+ const providerReturnTo = origin ? `${origin}${returnTo}` : returnTo;
1888
1893
  const line = { flex: 1, height: 1, background: "var(--border, #27272a)" };
1889
1894
  return /* @__PURE__ */ jsxs("div", { "data-oc-signin-providers": "", style: { marginTop: 20 }, children: [
1890
1895
  /* @__PURE__ */ jsxs(
@@ -1912,7 +1917,7 @@ function ProviderSignIn({
1912
1917
  "a",
1913
1918
  {
1914
1919
  href: `${authOrigin}/api/auth/${p.id}/start?return_to=${encodeURIComponent(
1915
- returnTo
1920
+ providerReturnTo
1916
1921
  )}`,
1917
1922
  "data-oc-signin-provider": p.id,
1918
1923
  style: {