@wacht/jsx 0.0.1-alpha.31 → 0.0.1-alpha.32

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.es.js CHANGED
@@ -1054,27 +1054,21 @@ function Sd() {
1054
1054
  },
1055
1055
  // Identifier-First flow methods
1056
1056
  identify: async (s) => {
1057
- console.log("[identify] Starting with identifier:", s);
1058
1057
  const a = new FormData();
1059
1058
  a.append("identifier", s);
1060
1059
  const h = await e("/auth/identify", {
1061
1060
  method: "POST",
1062
1061
  body: a
1063
1062
  });
1064
- console.log("[identify] Response status:", h.status);
1065
- const f = await q(h);
1066
- return console.log("[identify] Mapped result:", f), f.data;
1063
+ return (await q(h)).data;
1067
1064
  },
1068
1065
  initEnterpriseSso: async (s, a) => {
1069
- console.log("[initEnterpriseSso] Starting with connectionId:", s, "redirectUri:", a);
1070
1066
  const h = new URLSearchParams({ connection_id: s });
1071
1067
  a && h.append("redirect_uri", a);
1072
1068
  const f = await e(`/auth/sso/login?${h.toString()}`, {
1073
1069
  method: "POST"
1074
1070
  });
1075
- console.log("[initEnterpriseSso] Response status:", f.status);
1076
- const c = await q(f);
1077
- return console.log("[initEnterpriseSso] Mapped result:", c), c.data;
1071
+ return (await q(f)).data;
1078
1072
  }
1079
1073
  },
1080
1074
  discardSignInAttempt: () => {
@@ -1213,32 +1207,37 @@ function zd() {
1213
1207
  };
1214
1208
  }
1215
1209
  const Ke = () => {
1216
- const { adapter: e, deployment: t } = Se(), o = e.useNavigate(), n = (f, c) => {
1217
- o ? o(f, c) : window.location.href = f;
1210
+ const { adapter: e, deployment: t } = Se(), o = e.useNavigate(), n = (c, p) => {
1211
+ o ? o(c, p) : window.location.href = c;
1212
+ }, s = (c) => {
1213
+ if (c)
1214
+ return c;
1215
+ const d = new URLSearchParams(window.location.search).get("redirect_uri");
1216
+ return d || window.location.href;
1218
1217
  };
1219
1218
  return {
1220
1219
  navigate: n,
1221
- navigateToSignIn: (f) => {
1220
+ navigateToSignIn: (c) => {
1222
1221
  if (!t) return;
1223
- const c = f || window.location.href, p = new URLSearchParams();
1224
- p.set("redirect_uri", c), (t == null ? void 0 : t.mode) === "staging" && p.set("dev_session", localStorage.getItem("__dev_session__") ?? ""), n(
1225
- `${t.ui_settings.sign_in_page_url}?${p.toString()}`,
1222
+ const p = s(c), d = new URLSearchParams();
1223
+ d.set("redirect_uri", p), (t == null ? void 0 : t.mode) === "staging" && d.set("dev_session", localStorage.getItem("__dev_session__") ?? ""), n(
1224
+ `${t.ui_settings.sign_in_page_url}?${d.toString()}`,
1226
1225
  { replace: !0 }
1227
1226
  );
1228
1227
  },
1229
- navigateToAccountSelection: (f) => {
1228
+ navigateToAccountSelection: (c) => {
1230
1229
  if (!t) return;
1231
- const c = f || window.location.href, p = new URLSearchParams();
1232
- p.set("redirect_uri", c), (t == null ? void 0 : t.mode) === "staging" && p.set("dev_session", localStorage.getItem("__dev_session__") ?? ""), n(
1233
- `https://${t.frontend_host}?${p.toString()}`,
1230
+ const p = s(c), d = new URLSearchParams();
1231
+ d.set("redirect_uri", p), (t == null ? void 0 : t.mode) === "staging" && d.set("dev_session", localStorage.getItem("__dev_session__") ?? ""), n(
1232
+ `https://${t.frontend_host}?${d.toString()}`,
1234
1233
  { replace: !0 }
1235
1234
  );
1236
1235
  },
1237
- navigateToSignUp: (f) => {
1236
+ navigateToSignUp: (c) => {
1238
1237
  if (!t) return;
1239
- const c = f || window.location.href, p = new URLSearchParams();
1240
- p.set("redirect_uri", c), (t == null ? void 0 : t.mode) === "staging" && p.set("dev_session", localStorage.getItem("__dev_session__") ?? ""), n(
1241
- `${t.ui_settings.sign_up_page_url}?${p.toString()}`,
1238
+ const p = s(c), d = new URLSearchParams();
1239
+ d.set("redirect_uri", p), (t == null ? void 0 : t.mode) === "staging" && d.set("dev_session", localStorage.getItem("__dev_session__") ?? ""), n(
1240
+ `${t.ui_settings.sign_up_page_url}?${d.toString()}`,
1242
1241
  { replace: !0 }
1243
1242
  );
1244
1243
  }