@burdenoff/fe-libs 2026.518.4 → 2026.518.6

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.
@@ -20,6 +20,21 @@ export declare function markSSORedirectAttempt(relayOrigin: string, returnTo: st
20
20
  *
21
21
  * Call this from ProtectedRoute or LandingOrDashboardRedirect
22
22
  * before showing login page.
23
+ *
24
+ * Two discovery paths:
25
+ * 1. `bf-sso` cookie on the current origin pointing at a different
26
+ * product origin (set during a previous same-origin login). Used when
27
+ * the cookie can travel cross-subdomain (e.g. *.local.burdenoff.com).
28
+ * Falls through silently otherwise.
29
+ * 2. Central bridge host (alphaapp/app.burdenoff.com) fallback: cross
30
+ * eTLD+1 product hostnames can't share cookies with each other, so we
31
+ * optimistically redirect to the bridge host's `/auth/sso-relay`. The
32
+ * bridge host reads ITS own (first-party, unpartitioned) localStorage
33
+ * — which receives tokens from every product login via the deposit
34
+ * flow — and bounces them back to the original product origin via
35
+ * `/auth/sso-callback#sso=...`. On no central session the bridge
36
+ * bounces back with `?sso_failed=1` and `isAutoSSOSuppressed` keeps
37
+ * the user on the login screen.
23
38
  */
24
39
  export declare function getSSORedirectUrl(returnPath?: string): string | null;
25
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SSORedirectGuard.d.ts","sourceRoot":"","sources":["../../../src/shared/components/SSORedirectGuard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoGH,wBAAgB,qBAAqB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAGlE;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAM1F;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAiBlF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyBpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CA6BlC;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAyC9F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CA6B1C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,4CAMjC"}
1
+ {"version":3,"file":"SSORedirectGuard.d.ts","sourceRoot":"","sources":["../../../src/shared/components/SSORedirectGuard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqGH,wBAAgB,qBAAqB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAGlE;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAM1F;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAiBlF;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqCpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CA6BlC;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAyC9F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CA6B1C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,4CAMjC"}
@@ -1,13 +1,14 @@
1
- import { clearActiveContextStorage as e } from "../providers/shell/ActiveContextStorage.js";
2
- import { clearShellSsoCookies as t, isSharedSsoCookieDomain as n, isTrustedSsoOrigin as r, readShellSsoCookie as i } from "../utils/authCookie.js";
3
- import { jsx as a } from "react/jsx-runtime";
1
+ import { resolveAuthBridgeConfig as e } from "../config/authBridgeUrls.js";
2
+ import { clearActiveContextStorage as t } from "../providers/shell/ActiveContextStorage.js";
3
+ import { clearShellSsoCookies as n, isSharedSsoCookieDomain as r, isTrustedSsoOrigin as i, readShellSsoCookie as a } from "../utils/authCookie.js";
4
+ import { jsx as o } from "react/jsx-runtime";
4
5
  //#region src/shared/components/SSORedirectGuard.tsx
5
- var o = "bf-sso-relay-attempt", s = 120 * 1e3, c = [
6
+ var s = "bf-sso-relay-attempt", c = 120 * 1e3, l = [
6
7
  "sso_failed",
7
8
  "sso-failed",
8
9
  "sso-attempted"
9
10
  ];
10
- function l(e) {
11
+ function u(e) {
11
12
  if (typeof window > "u") return null;
12
13
  try {
13
14
  let t = `${window.location.pathname}${window.location.search}${window.location.hash}`, n = new URL(e ?? t, window.location.origin);
@@ -16,87 +17,93 @@ function l(e) {
16
17
  return null;
17
18
  }
18
19
  }
19
- function u(e) {
20
- return e === "/auth" || e.startsWith("/auth/");
21
- }
22
20
  function d(e) {
23
- return c.some((t) => e.searchParams.has(t));
21
+ return e === "/auth" || e.startsWith("/auth/");
24
22
  }
25
23
  function f(e) {
26
- if (d(e)) return t(), !0;
27
- if (u(e.pathname)) return !0;
28
- let n = e.searchParams.get("reason");
29
- return n === "session-expired" || n === "logout";
24
+ return l.some((t) => e.searchParams.has(t));
25
+ }
26
+ function p(e) {
27
+ if (f(e)) return n(), !0;
28
+ if (d(e.pathname)) return !0;
29
+ let t = e.searchParams.get("reason");
30
+ return t === "session-expired" || t === "logout";
30
31
  }
31
- function p() {
32
+ function m() {
32
33
  try {
33
- sessionStorage.removeItem(o);
34
+ sessionStorage.removeItem(s);
34
35
  } catch {}
35
36
  }
36
- function m() {
37
+ function h() {
37
38
  if (typeof window > "u") return null;
38
39
  try {
39
- let e = sessionStorage.getItem(o);
40
+ let e = sessionStorage.getItem(s);
40
41
  if (!e) return null;
41
42
  let t = JSON.parse(e);
42
- return typeof t.relayOrigin != "string" || typeof t.returnTo != "string" || typeof t.startedAt != "number" || Date.now() - t.startedAt > s ? (p(), null) : {
43
+ return typeof t.relayOrigin != "string" || typeof t.returnTo != "string" || typeof t.startedAt != "number" || Date.now() - t.startedAt > c ? (m(), null) : {
43
44
  relayOrigin: t.relayOrigin,
44
45
  returnTo: t.returnTo,
45
46
  startedAt: t.startedAt
46
47
  };
47
48
  } catch {
48
- return p(), null;
49
+ return m(), null;
49
50
  }
50
51
  }
51
- function h(e) {
52
+ function g(e) {
52
53
  try {
53
54
  return new URL(e).origin;
54
55
  } catch {
55
56
  return null;
56
57
  }
57
58
  }
58
- function g(e) {
59
- let t = l(e);
60
- return !t || f(t);
59
+ function _(e) {
60
+ let t = u(e);
61
+ return !t || p(t);
61
62
  }
62
- function _(e, t) {
63
- let n = h(e), r = l(t), i = m();
63
+ function v(e, t) {
64
+ let n = g(e), r = u(t), i = h();
64
65
  return !!(n && r && i?.returnTo === r.href);
65
66
  }
66
- function v(e, t) {
67
+ function y(e, t) {
67
68
  if (typeof window > "u") return;
68
- let n = h(e), r = l(t);
69
+ let n = g(e), r = u(t);
69
70
  if (!(!n || !r)) try {
70
71
  let e = {
71
72
  relayOrigin: n,
72
73
  returnTo: r.href,
73
74
  startedAt: Date.now()
74
75
  };
75
- sessionStorage.setItem(o, JSON.stringify(e));
76
+ sessionStorage.setItem(s, JSON.stringify(e));
76
77
  } catch {}
77
78
  }
78
- function y(e) {
79
+ function b(t) {
79
80
  try {
80
- let t = l(e);
81
- if (!t || f(t)) return null;
82
- let n = i();
83
- if (!n?.origin || !r(n.origin)) return null;
84
- let a = new URL(n.origin).origin;
85
- return !a || a === window.location.origin || _(a, t.href) ? null : (v(a, t.href), `${a}/auth/sso-relay?returnTo=${encodeURIComponent(t.href)}`);
81
+ let n = u(t);
82
+ if (!n || p(n)) return null;
83
+ let r = window.location.origin, o = a();
84
+ if (o?.origin && i(o.origin)) {
85
+ let e = new URL(o.origin).origin;
86
+ if (e && e !== r && !v(e, n.href)) return y(e, n.href), `${e}/auth/sso-relay?returnTo=${encodeURIComponent(n.href)}`;
87
+ }
88
+ try {
89
+ let t = e(), i = new URL(t.url).origin;
90
+ if (i && i !== r && !v(i, n.href)) return y(i, n.href), `${i}/auth/sso-relay?returnTo=${encodeURIComponent(n.href)}`;
91
+ } catch {}
92
+ return null;
86
93
  } catch {
87
94
  return null;
88
95
  }
89
96
  }
90
- function b() {
97
+ function x() {
91
98
  try {
92
- if (i()) return !1;
99
+ if (a()) return !1;
93
100
  let e = sessionStorage.getItem("bf-active-profile");
94
- return !e || !localStorage.getItem(`bf-p-${e}-tokens`) || !n() ? !1 : (S(), !0);
101
+ return !e || !localStorage.getItem(`bf-p-${e}-tokens`) || !r() ? !1 : (C(), !0);
95
102
  } catch {
96
103
  return !1;
97
104
  }
98
105
  }
99
- async function x(e, t) {
106
+ async function S(e, t) {
100
107
  try {
101
108
  let n = await fetch(e, {
102
109
  method: "POST",
@@ -113,22 +120,22 @@ async function x(e, t) {
113
120
  return !1;
114
121
  }
115
122
  }
116
- function S() {
123
+ function C() {
117
124
  try {
118
- let n = localStorage.getItem("bf-profiles");
119
- if (n) {
120
- let e = JSON.parse(n);
121
- for (let t of e) localStorage.removeItem(`bf-p-${t.id}-tokens`), localStorage.removeItem(`bf-p-${t.id}-user`), localStorage.removeItem(`bf-p-${t.id}-workspace-token`), localStorage.removeItem(`bf-p-${t.id}-context`), localStorage.removeItem(`bf-p-${t.id}-auth-storage`), sessionStorage.removeItem(`bf-p-${t.id}-session-workspace-token`);
125
+ let e = localStorage.getItem("bf-profiles");
126
+ if (e) {
127
+ let t = JSON.parse(e);
128
+ for (let e of t) localStorage.removeItem(`bf-p-${e.id}-tokens`), localStorage.removeItem(`bf-p-${e.id}-user`), localStorage.removeItem(`bf-p-${e.id}-workspace-token`), localStorage.removeItem(`bf-p-${e.id}-context`), localStorage.removeItem(`bf-p-${e.id}-auth-storage`), sessionStorage.removeItem(`bf-p-${e.id}-session-workspace-token`);
122
129
  }
123
130
  for (let e of Object.keys(localStorage)) e.startsWith("bf-p-") && e.endsWith("-auth-storage") && localStorage.removeItem(e);
124
- localStorage.removeItem("bf-profiles"), localStorage.removeItem("auth-storage"), sessionStorage.removeItem("bf-active-profile"), e(), t(), window.dispatchEvent(new Event("bf-auth-state-cleared")), window.dispatchEvent(new Event("bf-profile-storage-change"));
131
+ localStorage.removeItem("bf-profiles"), localStorage.removeItem("auth-storage"), sessionStorage.removeItem("bf-active-profile"), t(), n(), window.dispatchEvent(new Event("bf-auth-state-cleared")), window.dispatchEvent(new Event("bf-profile-storage-change"));
125
132
  } catch {}
126
133
  }
127
- function C() {
128
- return /* @__PURE__ */ a("div", {
134
+ function w() {
135
+ return /* @__PURE__ */ o("div", {
129
136
  className: "flex items-center justify-center min-h-screen",
130
- children: /* @__PURE__ */ a("div", { className: "animate-spin rounded-full h-8 w-8 border-2 border-action-primary-bg border-t-transparent" })
137
+ children: /* @__PURE__ */ o("div", { className: "animate-spin rounded-full h-8 w-8 border-2 border-action-primary-bg border-t-transparent" })
131
138
  });
132
139
  }
133
140
  //#endregion
134
- export { C as SSORedirectSpinner, x as checkRemoteSLO, b as checkSLO, S as clearLocalAuthState, y as getSSORedirectUrl, _ as hasRecentSSORedirectAttempt, v as markSSORedirectAttempt, g as shouldSkipSSORedirect };
141
+ export { w as SSORedirectSpinner, S as checkRemoteSLO, x as checkSLO, C as clearLocalAuthState, b as getSSORedirectUrl, v as hasRecentSSORedirectAttempt, y as markSSORedirectAttempt, _ as shouldSkipSSORedirect };
@@ -152,7 +152,7 @@ function j() {
152
152
  let e = O();
153
153
  return e.__graphqlFetchPendingResponses ||= /* @__PURE__ */ new Map(), e.__graphqlFetchPendingResponses;
154
154
  }
155
- var M = 50, N = 2500, P = 100, F = 1e4, I = 15e3, L = new Set([
155
+ var M = 10, N = 2500, P = 100, F = 1e4, I = 15e3, L = new Set([
156
156
  "traceparent",
157
157
  "tracestate",
158
158
  "baggage"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.518.4",
3
+ "version": "2026.518.6",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {