@hexclave/next 1.0.76 → 1.0.77
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/{admin-app-impl-CsH-gVGz.d.ts → admin-app-impl-CxDpE89P.d.ts} +12 -10
- package/dist/admin-app-impl-CxDpE89P.d.ts.map +1 -0
- package/dist/clickmap/clickmap-core.d.ts +1 -1
- package/dist/clickmap/index.d.ts +1 -1
- package/dist/{client-app-BCT5p_70.d.ts → client-app-wFodsYml.d.ts} +4 -1
- package/dist/client-app-wFodsYml.d.ts.map +1 -0
- package/dist/common-BK_sydxF.d.ts.map +1 -1
- package/dist/components/api-key-dialogs.d.ts +1 -1
- package/dist/components/elements/sidebar-layout.d.ts.map +1 -1
- package/dist/components/elements/sidebar-layout.js +12 -2
- package/dist/components/elements/sidebar-layout.js.map +1 -1
- package/dist/components/selected-team-switcher.d.ts +1 -1
- package/dist/components/team-icon.d.ts +1 -1
- package/dist/components/team-switcher.d.ts +1 -1
- package/dist/components-page/account-settings/payments/payments-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/leave-team-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-api-keys-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-display-name-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-invitation-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-list-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-image-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-user-section.d.ts +1 -1
- package/dist/components-page/hexclave-handler-client.d.ts +1 -1
- package/dist/components-page/hexclave-handler.d.ts +1 -1
- package/dist/components-page/team-invitation-cache.d.ts +5 -0
- package/dist/components-page/team-invitation-cache.d.ts.map +1 -0
- package/dist/components-page/team-invitation-cache.js +12 -0
- package/dist/components-page/team-invitation-cache.js.map +1 -0
- package/dist/components-page/team-invitation-cache.test.d.ts +1 -0
- package/dist/components-page/team-invitation-cache.test.js +23 -0
- package/dist/components-page/team-invitation-cache.test.js.map +1 -0
- package/dist/components-page/team-invitation.js +8 -7
- package/dist/components-page/team-invitation.js.map +1 -1
- package/dist/dev-tool/dev-tool-core.d.ts +1 -1
- package/dist/dev-tool/index.d.ts +1 -1
- package/dist/esm/components/api-key-dialogs.d.ts +1 -1
- package/dist/esm/components/elements/sidebar-layout.d.ts.map +1 -1
- package/dist/esm/components/elements/sidebar-layout.js +12 -2
- package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
- package/dist/esm/components-page/team-invitation-cache.d.ts +5 -0
- package/dist/esm/components-page/team-invitation-cache.d.ts.map +1 -0
- package/dist/esm/components-page/team-invitation-cache.js +11 -0
- package/dist/esm/components-page/team-invitation-cache.js.map +1 -0
- package/dist/esm/components-page/team-invitation-cache.test.d.ts +1 -0
- package/dist/esm/components-page/team-invitation-cache.test.js +24 -0
- package/dist/esm/components-page/team-invitation-cache.test.js.map +1 -0
- package/dist/esm/components-page/team-invitation.d.ts.map +1 -1
- package/dist/esm/components-page/team-invitation.js +8 -7
- package/dist/esm/components-page/team-invitation.js.map +1 -1
- package/dist/esm/generated/quetzal-translations.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +4 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js +30 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +5 -3
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +94 -21
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.js +83 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.js +120 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/common.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +4 -3
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/index.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -1
- package/dist/esm/lib/hexclave-app/teams/index.d.ts +3 -0
- package/dist/esm/lib/hexclave-app/teams/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/teams/index.js.map +1 -1
- package/dist/esm/utils/monkey-patch.d.ts +7 -0
- package/dist/esm/utils/monkey-patch.d.ts.map +1 -0
- package/dist/esm/utils/monkey-patch.js +20 -0
- package/dist/esm/utils/monkey-patch.js.map +1 -0
- package/dist/esm/utils/react.d.ts +17 -0
- package/dist/esm/utils/react.d.ts.map +1 -0
- package/dist/esm/utils/react.js +60 -0
- package/dist/esm/utils/react.js.map +1 -0
- package/dist/generated/quetzal-translations.d.ts +1 -1
- package/dist/{hexclave-provider-BA97jMlx.d.ts → hexclave-provider-CMz2mt4I.d.ts} +3 -3
- package/dist/{hexclave-provider-BA97jMlx.d.ts.map → hexclave-provider-CMz2mt4I.d.ts.map} +1 -1
- package/dist/{hooks-CUe5bc3s.d.ts → hooks-CUHt4Y9C.d.ts} +2 -2
- package/dist/{hooks-CUe5bc3s.d.ts.map → hooks-CUHt4Y9C.d.ts.map} +1 -1
- package/dist/{index-CvB7XacB.d.ts → index-fR0LkUK7.d.ts} +2 -2
- package/dist/{index-CvB7XacB.d.ts.map → index-fR0LkUK7.d.ts.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js +29 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +2 -2
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +93 -19
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.js +82 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.js +119 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/common.js +4 -3
- package/dist/lib/hexclave-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/index.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -1
- package/dist/lib/hexclave-app/apps/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/server-app.d.ts +1 -1
- package/dist/lib/hexclave-app/index.d.ts +1 -1
- package/dist/lib/hexclave-app/projects/index.d.ts +1 -1
- package/dist/lib/hexclave-app/teams/index.d.ts +1 -1
- package/dist/lib/hexclave-app/teams/index.js.map +1 -1
- package/dist/lib/hexclave-app/users/index.d.ts +1 -1
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/providers/hexclave-context.d.ts +1 -1
- package/dist/providers/hexclave-provider-client.d.ts +1 -1
- package/dist/providers/hexclave-provider.d.ts +1 -1
- package/dist/providers/translation-provider.d.ts +1 -1
- package/dist/pushed-config-error-overlay/index.d.ts +1 -1
- package/dist/{quetzal-translations-CK45_4Dm.d.ts → quetzal-translations-B2jT2SWm.d.ts} +3 -3
- package/dist/{quetzal-translations-CK45_4Dm.d.ts.map → quetzal-translations-B2jT2SWm.d.ts.map} +1 -1
- package/dist/team-invitation-B5Ol7vdd.d.ts.map +1 -1
- package/dist/{translation-provider-DQ3BJepJ.d.ts → translation-provider-6505O9P2.d.ts} +2 -2
- package/dist/{translation-provider-DQ3BJepJ.d.ts.map → translation-provider-6505O9P2.d.ts.map} +1 -1
- package/dist/utils/monkey-patch.d.ts +7 -0
- package/dist/utils/monkey-patch.d.ts.map +1 -0
- package/dist/utils/monkey-patch.js +23 -0
- package/dist/utils/monkey-patch.js.map +1 -0
- package/dist/utils/react.d.ts +17 -0
- package/dist/utils/react.d.ts.map +1 -0
- package/dist/utils/react.js +63 -0
- package/dist/utils/react.js.map +1 -0
- package/package.json +4 -4
- package/src/components/elements/sidebar-layout.tsx +16 -1
- package/src/components-page/team-invitation-cache.test.ts +25 -0
- package/src/components-page/team-invitation-cache.ts +13 -0
- package/src/components-page/team-invitation.tsx +16 -7
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts +38 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts +2 -3
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.sign-out.test.ts +96 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +134 -24
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.untrusted-redirect-card.test.ts +146 -0
- package/src/lib/hexclave-app/apps/implementations/common.ts +2 -1
- package/src/lib/hexclave-app/teams/index.ts +3 -0
- package/src/utils/monkey-patch.tsx +31 -0
- package/src/utils/react.tsx +93 -0
- package/dist/admin-app-impl-CsH-gVGz.d.ts.map +0 -1
- package/dist/client-app-BCT5p_70.d.ts.map +0 -1
|
@@ -205,7 +205,7 @@ declare class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
205
205
|
} & {
|
|
206
206
|
uniqueIdentifier: string;
|
|
207
207
|
};
|
|
208
|
-
setCurrentUser: (userJsonPromise: Promise<import("@hexclave/shared/dist/current-user-
|
|
208
|
+
setCurrentUser: (userJsonPromise: Promise<import("@hexclave/shared/dist/current-user-BO0U7S87").t["Client"]["Read"] | null>) => void;
|
|
209
209
|
getConstructorOptions: () => {
|
|
210
210
|
baseUrl?: string | {
|
|
211
211
|
browser: string;
|
|
@@ -238,11 +238,11 @@ declare class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
238
238
|
sendAnalyticsEventBatch: (body: string, options: {
|
|
239
239
|
keepalive: boolean;
|
|
240
240
|
}) => Promise<Result<Response, Error>>;
|
|
241
|
-
addRequestListener: (listener: import("@hexclave/shared/dist/client-interface-
|
|
241
|
+
addRequestListener: (listener: import("@hexclave/shared/dist/client-interface-D3ro3nO_").r) => () => void;
|
|
242
242
|
sendRequest: (path: string, requestOptions: RequestInit, requestType?: "client" | "server" | "admin") => Promise<Response & {
|
|
243
243
|
usedTokens: {
|
|
244
|
-
accessToken: import("@hexclave/shared/dist/sessions-
|
|
245
|
-
refreshToken: import("@hexclave/shared/dist/sessions-
|
|
244
|
+
accessToken: import("@hexclave/shared/dist/sessions-CljaxQdd").t;
|
|
245
|
+
refreshToken: import("@hexclave/shared/dist/sessions-CljaxQdd").i | null;
|
|
246
246
|
} | null;
|
|
247
247
|
}>;
|
|
248
248
|
getUrls: () => Readonly<import("@hexclave/shared/dist/handler-urls-BHt3v8Ai").s>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-app-impl.d.ts","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/admin-app-impl.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;KAwCK,iBAAA,GAAoB,OAAA,CAAQ,UAAA,CAAW,sBAAA;AAAA,cAqC/B,+BAAA,kEAAiG,gCAAA,CAAiC,aAAA,EAAe,SAAA,aAAsB,aAAA,CAAc,aAAA,EAAe,SAAA;EAAA,UAC7L,UAAA,EAAY,sBAAA;EAAA,iBAEb,kBAAA;EAAA,iBAGA,eAAA;EAAA,iBAGA,qBAAA;EAAA,iBAIA,qBAAA;EAAA,iBAGA,sBAAA;EAAA,iBAGA,yBAAA;EAAA,iBAGA,sBAAA;EAAA,iBAGA,oBAAA;EAAA,iBAGA,oCAAA;EAAA,iBAGA,uCAAA;EAAA,iBAGA,eAAA;EAAA,iBAMA,aAAA;EAAA,iBAIA,kBAAA;EAAA,iBAGA,uBAAA;EAAA,iBAGA,kBAAA;EAAA,iBAGA,qCAAA;EAAA,iBAGA,qBAAA;EAAA,iBAGA,uBAAA;EAAA,iBAUA,kBAAA;cAIL,OAAA,EAAS,+BAAA,CAAgC,aAAA,EAAe,SAAA,GAAY,YAAA;IAAiB,gBAAA;IAA2B,WAAA;IAAsB,SAAA,GAAY,sBAAA;EAAA;EA2B9J,oBAAA,CAAqB,IAAA;IAAQ,aAAA;EAAA,IAA0B,cAAA;EAIvD,0BAAA,CA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mB,OAAA,GAAU,yBAAA,GAA4B,OAAA,CAAQ,wBAAA;EAgCjE,gBAAA,CAAiB,eAAA,WAA0B,OAAA,CAAQ,kBAAA;EAgBnD,uBAAA,CAAwB,eAAA,UAAyB,OAAA,GAAU,8BAAA,GAAiC,OAAA,CAAQ,6BAAA;EAwBpG,2BAAA,CAA4B,eAAA,UAAyB,OAAA,WAAkB,OAAA,CAAQ,wCAAA;EAI/E,sBAAA,CAAuB,eAAA,UAAyB,OAAA;IAAY,MAAA;IAAiB,KAAA;EAAA,IAAmB,OAAA,CAAQ,4BAAA;EAoBxG,sCAAA,CACJ,UAAA;IAAc,wBAAA;EAAA,GACd,KAAA,YACC,OAAA;IACD,aAAA,EAAe,KAAA;MACb,EAAA;MACA,WAAA;MACA,YAAA;MACA,gBAAA,EAAkB,gBAAA;IAAA;IAEpB,kBAAA;EAAA;AAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
2
|
import { hexclaveAppInternalsSymbol } from "../../common.js";
|
|
3
3
|
import { HexclaveClientApp } from "../interfaces/client-app.js";
|
|
4
|
+
import { stripBrowserActionQueryParam } from "./client-app-impl.js";
|
|
4
5
|
//#region src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts
|
|
5
6
|
const baseOptions = {
|
|
6
7
|
baseUrl: "http://localhost:12345",
|
|
@@ -95,6 +96,34 @@ describe("HexclaveClientApp automatic side effects", () => {
|
|
|
95
96
|
const first = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);
|
|
96
97
|
expect(HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json)).toBe(first);
|
|
97
98
|
});
|
|
99
|
+
it("keeps stripping the browser action parameter after a router restores it", () => {
|
|
100
|
+
vi.useFakeTimers();
|
|
101
|
+
const previousWindow = Reflect.get(globalThis, "window");
|
|
102
|
+
const hadPreviousWindow = Reflect.has(globalThis, "window");
|
|
103
|
+
let currentHref = "http://localhost:12345/?hexclave_action_id=action-id";
|
|
104
|
+
Reflect.set(globalThis, "window", {
|
|
105
|
+
location: { get href() {
|
|
106
|
+
return currentHref;
|
|
107
|
+
} },
|
|
108
|
+
history: {
|
|
109
|
+
state: null,
|
|
110
|
+
replaceState: (_state, _title, url) => {
|
|
111
|
+
currentHref = String(url);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
setTimeout
|
|
115
|
+
});
|
|
116
|
+
try {
|
|
117
|
+
stripBrowserActionQueryParam();
|
|
118
|
+
currentHref = "http://localhost:12345/?hexclave_action_id=action-id";
|
|
119
|
+
vi.runAllTimers();
|
|
120
|
+
expect(currentHref).toBe("http://localhost:12345/");
|
|
121
|
+
} finally {
|
|
122
|
+
vi.useRealTimers();
|
|
123
|
+
if (hadPreviousWindow) Reflect.set(globalThis, "window", previousWindow);
|
|
124
|
+
else Reflect.deleteProperty(globalThis, "window");
|
|
125
|
+
}
|
|
126
|
+
});
|
|
98
127
|
});
|
|
99
128
|
//#endregion
|
|
100
129
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app-impl.automatic-side-effects.test.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { describe, expect, it } from \"vitest\";\nimport { hexclaveAppInternalsSymbol } from \"../../common\";\nimport { HexclaveClientApp, HexclaveClientAppConstructorOptions, HexclaveClientAppJson } from \"../interfaces/client-app\";\n\nconst baseOptions = {\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000000\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"none\",\n} satisfies HexclaveClientAppConstructorOptions<true, string>;\n\ndescribe(\"HexclaveClientApp automatic side effects\", () => {\n it(\"does not inspect browser state when disabled\", () => {\n const previousWindow = Reflect.get(globalThis, \"window\");\n const previousDocument = Reflect.get(globalThis, \"document\");\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n const hadPreviousDocument = Reflect.has(globalThis, \"document\");\n const browserGlobal = {};\n Object.defineProperty(browserGlobal, \"location\", {\n get() {\n throw new Error(\"Construction must not inspect the current URL when automatic side effects are disabled\");\n },\n });\n\n Reflect.set(globalThis, \"window\", browserGlobal);\n Object.defineProperty(globalThis, \"document\", {\n configurable: true,\n get() {\n throw new Error(\"Construction must not access the document when automatic side effects are disabled\");\n },\n });\n\n try {\n expect(() => new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects: false,\n })).not.toThrow();\n } finally {\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n if (hadPreviousDocument) {\n Object.defineProperty(globalThis, \"document\", {\n configurable: true,\n value: previousDocument,\n writable: true,\n });\n } else {\n Reflect.deleteProperty(globalThis, \"document\");\n }\n }\n });\n\n it(\"does not initialize automatic side effects when disabled\", () => {\n const methodName = \"_initializeAutomaticSideEffects\";\n const originalInitializer = Reflect.get(HexclaveClientApp.prototype, methodName);\n let initializationCalls = 0;\n Reflect.set(HexclaveClientApp.prototype, methodName, () => {\n initializationCalls += 1;\n });\n\n try {\n new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects: false,\n });\n\n expect(initializationCalls).toBe(0);\n } finally {\n Reflect.set(HexclaveClientApp.prototype, methodName, originalInitializer);\n }\n });\n\n it.each([undefined, true])(\"retains automatic initialization when automaticSideEffects is %s\", (automaticSideEffects) => {\n const methodName = \"_initializeAutomaticSideEffects\";\n const originalInitializer = Reflect.get(HexclaveClientApp.prototype, methodName);\n let initializationCalls = 0;\n Reflect.set(HexclaveClientApp.prototype, methodName, () => {\n initializationCalls += 1;\n });\n\n try {\n new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects,\n });\n\n expect(initializationCalls).toBe(1);\n } finally {\n Reflect.set(HexclaveClientApp.prototype, methodName, originalInitializer);\n }\n });\n\n it(\"preserves the option through serialization\", () => {\n const app = new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects: false,\n });\n\n expect(app[hexclaveAppInternalsSymbol].toClientJson().automaticSideEffects).toBe(false);\n });\n\n it(\"preserves stable identity when deserializing with automatic side effects disabled\", () => {\n const json: HexclaveClientAppJson<false, string> = {\n baseUrl: baseOptions.baseUrl,\n projectId: baseOptions.projectId,\n publishableClientKey: baseOptions.publishableClientKey,\n tokenStore: null,\n redirectMethod: baseOptions.redirectMethod,\n automaticSideEffects: false,\n uniqueIdentifier: \"00000000-0000-4000-8000-000000000001\",\n };\n\n const first = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);\n const second = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);\n\n expect(second).toBe(first);\n });\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client-app-impl.automatic-side-effects.test.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { describe, expect, it, vi } from \"vitest\";\nimport { hexclaveAppInternalsSymbol } from \"../../common\";\nimport { HexclaveClientApp, HexclaveClientAppConstructorOptions, HexclaveClientAppJson } from \"../interfaces/client-app\";\nimport { stripBrowserActionQueryParam } from \"./client-app-impl\";\n\nconst baseOptions = {\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000000\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"none\",\n} satisfies HexclaveClientAppConstructorOptions<true, string>;\n\ndescribe(\"HexclaveClientApp automatic side effects\", () => {\n it(\"does not inspect browser state when disabled\", () => {\n const previousWindow = Reflect.get(globalThis, \"window\");\n const previousDocument = Reflect.get(globalThis, \"document\");\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n const hadPreviousDocument = Reflect.has(globalThis, \"document\");\n const browserGlobal = {};\n Object.defineProperty(browserGlobal, \"location\", {\n get() {\n throw new Error(\"Construction must not inspect the current URL when automatic side effects are disabled\");\n },\n });\n\n Reflect.set(globalThis, \"window\", browserGlobal);\n Object.defineProperty(globalThis, \"document\", {\n configurable: true,\n get() {\n throw new Error(\"Construction must not access the document when automatic side effects are disabled\");\n },\n });\n\n try {\n expect(() => new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects: false,\n })).not.toThrow();\n } finally {\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n if (hadPreviousDocument) {\n Object.defineProperty(globalThis, \"document\", {\n configurable: true,\n value: previousDocument,\n writable: true,\n });\n } else {\n Reflect.deleteProperty(globalThis, \"document\");\n }\n }\n });\n\n it(\"does not initialize automatic side effects when disabled\", () => {\n const methodName = \"_initializeAutomaticSideEffects\";\n const originalInitializer = Reflect.get(HexclaveClientApp.prototype, methodName);\n let initializationCalls = 0;\n Reflect.set(HexclaveClientApp.prototype, methodName, () => {\n initializationCalls += 1;\n });\n\n try {\n new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects: false,\n });\n\n expect(initializationCalls).toBe(0);\n } finally {\n Reflect.set(HexclaveClientApp.prototype, methodName, originalInitializer);\n }\n });\n\n it.each([undefined, true])(\"retains automatic initialization when automaticSideEffects is %s\", (automaticSideEffects) => {\n const methodName = \"_initializeAutomaticSideEffects\";\n const originalInitializer = Reflect.get(HexclaveClientApp.prototype, methodName);\n let initializationCalls = 0;\n Reflect.set(HexclaveClientApp.prototype, methodName, () => {\n initializationCalls += 1;\n });\n\n try {\n new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects,\n });\n\n expect(initializationCalls).toBe(1);\n } finally {\n Reflect.set(HexclaveClientApp.prototype, methodName, originalInitializer);\n }\n });\n\n it(\"preserves the option through serialization\", () => {\n const app = new HexclaveClientApp({\n ...baseOptions,\n automaticSideEffects: false,\n });\n\n expect(app[hexclaveAppInternalsSymbol].toClientJson().automaticSideEffects).toBe(false);\n });\n\n it(\"preserves stable identity when deserializing with automatic side effects disabled\", () => {\n const json: HexclaveClientAppJson<false, string> = {\n baseUrl: baseOptions.baseUrl,\n projectId: baseOptions.projectId,\n publishableClientKey: baseOptions.publishableClientKey,\n tokenStore: null,\n redirectMethod: baseOptions.redirectMethod,\n automaticSideEffects: false,\n uniqueIdentifier: \"00000000-0000-4000-8000-000000000001\",\n };\n\n const first = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);\n const second = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);\n\n expect(second).toBe(first);\n });\n\n it(\"keeps stripping the browser action parameter after a router restores it\", () => {\n vi.useFakeTimers();\n const previousWindow = Reflect.get(globalThis, \"window\");\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n let currentHref = \"http://localhost:12345/?hexclave_action_id=action-id\";\n const browserGlobal = {\n location: {\n get href() {\n return currentHref;\n },\n },\n history: {\n state: null,\n replaceState: (_state: null, _title: string, url: string | URL) => {\n currentHref = String(url);\n },\n },\n setTimeout,\n };\n\n Reflect.set(globalThis, \"window\", browserGlobal);\n try {\n stripBrowserActionQueryParam();\n currentHref = \"http://localhost:12345/?hexclave_action_id=action-id\";\n vi.runAllTimers();\n expect(currentHref).toBe(\"http://localhost:12345/\");\n } finally {\n vi.useRealTimers();\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n});\n"],"mappings":";;;;;AASA,MAAM,cAAc;CAClB,SAAS;CACT,WAAW;CACX,sBAAsB;CACtB,YAA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AC/C,IAAI;GACF,6BAA6B;GAC7B,cAAc;GACd,GAAG,aAAa;GAChB,OAAO,WAAW,CAAC,CAAC,KAAK,yBAAyB;EACpD,UAAU;GACR,GAAG,cAAc;GACjB,IAAI,mBACF,QAAQ,IAAI,YAAY,UAAU,cAAc;QAEhD,QAAQ,eAAe,YAAY,QAAQ;EAE/C;CACF,CAAC;AACH,CAAC"}
|
package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app-impl.cross-domain.test.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { describe, expect, it, vi } from \"vitest\";\nimport { AccessToken } from \"@hexclave/shared/dist/sessions\";\nimport { HexclaveSetupError } from \"@hexclave/shared/dist/utils/errors\";\nimport { Store } from \"@hexclave/shared/dist/utils/stores\";\nimport { hexclaveAppInternalsSymbol } from \"../../common\";\nimport { StackClientApp } from \"../interfaces/client-app\";\nimport { planRedirectToHandler } from \"./redirect-page-urls\";\n\n// Every app in this file is constructed with `devTool: false`. The tests install a mock window and document, which makes\n// the SDK believe it is in a browser, and mounting the dev tool kicks off a background `getProject()` against a backend\n// that does not exist here. That fetch never settles, and because it runs inside the global store lock, it blocks every\n// later `withWriteLock` caller (`_signOut`, most visibly) for the rest of the test file.\nfunction createAccessTokenString(refreshTokenId: string): string {\n const encode = (value: unknown) => Buffer.from(JSON.stringify(value)).toString(\"base64url\");\n const nowSeconds = Math.floor(Date.now() / 1000);\n return [\n encode({ alg: \"none\", typ: \"JWT\" }),\n encode({\n sub: \"user-id\",\n exp: nowSeconds + 60,\n iat: nowSeconds,\n iss: \"https://api.example.test\",\n aud: \"project-id\",\n project_id: \"project-id\",\n branch_id: \"main\",\n refresh_token_id: refreshTokenId,\n role: \"authenticated\",\n name: null,\n email: null,\n email_verified: false,\n selected_team_id: null,\n signed_up_at: nowSeconds,\n is_anonymous: false,\n is_restricted: false,\n restricted_reason: null,\n requires_totp_mfa: false,\n }),\n \"\",\n ].join(\".\");\n}\n\nfunction createMockDocument(): Document {\n const cookieJar = new Map<string, string>();\n return {\n get cookie() {\n return [...cookieJar.entries()].map(([key, value]) => `${key}=${value}`).join(\"; \");\n },\n set cookie(str: string) {\n const [nameValue] = str.split(\";\");\n const eqIndex = nameValue.indexOf(\"=\");\n if (eqIndex < 0) return;\n cookieJar.set(nameValue.slice(0, eqIndex).trim(), nameValue.slice(eqIndex + 1).trim());\n },\n createElement: () => ({}),\n } as any;\n}\n\n/**\n * Installs a stand-in for `window` with only the parts the code under test touches. `globalThis.window` is typed as a\n * full `Window`, which a hand-written stub can never be, so the assignment goes through `Reflect.set` — the stub's own\n * shape stays checked, unlike with a cast on the object literal.\n */\nfunction setMockWindow(mockWindow: {\n location: { href: string, replace?: (url: string) => void },\n}): void {\n Reflect.set(globalThis, \"window\", mockWindow);\n}\n\n/**\n * Calls one of the app's `protected` methods, which are part of the flows under test but not of the public SDK surface.\n */\nfunction callProtectedMethod(app: StackClientApp<true>, methodName: string, ...args: unknown[]): Promise<unknown> {\n const method = Reflect.get(app, methodName);\n if (typeof method !== \"function\") {\n throw new Error(`Expected StackClientApp to have a ${methodName} method in tests.`);\n }\n return method.apply(app, args);\n}\n\ndescribe(\"StackClientApp cross-domain auth\", () => {\n it(\"keeps noRedirectBack same-domain redirects free of redirect-back state\", async () => {\n const redirectPlan = await planRedirectToHandler({\n handlerName: \"signIn\",\n rawHandlerUrl: \"/handler/sign-in\",\n noRedirectBack: true,\n currentUrl: new URL(\"https://app.example.test/settings?tab=profile\"),\n localOAuthCallbackUrl: \"/handler/oauth-callback\",\n rawHomeUrl: \"/home\",\n getCrossDomainHandoffParams: async () => {\n throw new Error(\"Same-domain redirects must not create cross-domain handoff parameters.\");\n },\n });\n\n expect(redirectPlan).toEqual({\n type: \"redirect\",\n url: \"/handler/sign-in\",\n });\n });\n\n it(\"returns noRedirectBack cross-domain auth to the source app home\", async () => {\n const handoffState = \"no-redirect-back-state\";\n const handoffCodeChallenge = \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\";\n const currentUrl = new URL(\"https://app.example.test/settings?tab=profile\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", handoffState);\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", handoffCodeChallenge);\n currentUrl.searchParams.set(\n \"hexclave_cross_domain_after_callback_redirect_url\",\n \"https://app.example.test/settings?tab=profile\",\n );\n\n const redirectPlan = await planRedirectToHandler({\n handlerName: \"signIn\",\n rawHandlerUrl: \"https://auth.example.test/handler/sign-in\",\n noRedirectBack: true,\n currentUrl,\n localOAuthCallbackUrl: \"/handler/oauth-callback\",\n rawHomeUrl: \"/home\",\n getCrossDomainHandoffParams: async () => {\n throw new Error(\"Existing cross-domain handoff parameters must be reused.\");\n },\n });\n\n expect(redirectPlan.type).toBe(\"redirect\");\n if (redirectPlan.type !== \"redirect\") {\n throw new Error(\"Expected noRedirectBack sign-in to produce a redirect URL.\");\n }\n\n const hostedUrl = new URL(redirectPlan.url);\n expect(hostedUrl.origin).toBe(\"https://auth.example.test\");\n expect(hostedUrl.pathname).toBe(\"/handler/sign-in\");\n expect(hostedUrl.searchParams.get(\"hexclave_cross_domain_after_callback_redirect_url\")).toBe(\n \"https://app.example.test/home\",\n );\n\n const rawSourceCallbackUrl = hostedUrl.searchParams.get(\"after_auth_return_to\");\n if (rawSourceCallbackUrl == null) {\n throw new Error(\"Expected cross-domain noRedirectBack to include its internal source callback URL.\");\n }\n const sourceCallbackUrl = new URL(rawSourceCallbackUrl);\n expect(sourceCallbackUrl.origin).toBe(\"https://app.example.test\");\n expect(sourceCallbackUrl.pathname).toBe(\"/handler/oauth-callback\");\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_auth\")).toBe(\"1\");\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_state\")).toBe(handoffState);\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_code_challenge\")).toBe(handoffCodeChallenge);\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_after_callback_redirect_url\")).toBe(\n \"https://app.example.test/home\",\n );\n expect(sourceCallbackUrl.toString()).not.toContain(\"/settings\");\n });\n\n it(\"exposes redirect-back-aware handler URLs for devtool previews\", async () => {\n const previousWindow = Reflect.get(globalThis, \"window\");\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n Reflect.set(globalThis, \"window\", {\n location: {\n href: \"http://localhost/music?track=1#song\",\n },\n });\n\n try {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000000\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"none\",\n urls: {\n signIn: \"/handler/sign-in\",\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n const redirectUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"signIn\");\n\n const resolved = new URL(redirectUrl, \"http://localhost\");\n expect(resolved.pathname).toBe(\"/handler/sign-in\");\n expect(resolved.searchParams.get(\"after_auth_return_to\")).toBe(\"/music?track=1#song\");\n } finally {\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n\n it(\"uses the fresh post-auth refresh token when minting a cross-domain handoff\", async () => {\n const freshAccessToken = createAccessTokenString(\"fresh-refresh-token-id\");\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000000\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: {\n accessToken: createAccessTokenString(\"stale-refresh-token-id\"),\n refreshToken: \"stale-refresh-token\",\n },\n redirectMethod: \"none\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalSendClientRequest = Reflect.get(clientInterface, \"sendClientRequest\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n const capturedRefreshTokens: string[] = [];\n const capturedAccessTokenRefreshTokenIds: string[] = [];\n const refreshedRawRefreshTokens: string[] = [];\n\n Reflect.set(clientInterface, \"sendClientRequest\", async (_path: unknown, _requestOptions: unknown, session: unknown) => {\n const getRefreshToken = Reflect.get(session ?? {}, \"getRefreshToken\");\n const getOrFetchLikelyValidTokens = Reflect.get(session ?? {}, \"getOrFetchLikelyValidTokens\");\n if (typeof getRefreshToken !== \"function\") {\n throw new Error(\"Expected cross-domain auth to pass a session to the client interface.\");\n }\n if (typeof getOrFetchLikelyValidTokens !== \"function\") {\n throw new Error(\"Expected cross-domain auth to pass a session with token accessors.\");\n }\n const refreshToken = getRefreshToken.call(session);\n const refreshTokenString = Reflect.get(refreshToken ?? {}, \"token\");\n if (typeof refreshTokenString !== \"string\") {\n throw new Error(\"Expected cross-domain auth to pass a refresh-token-backed session.\");\n }\n capturedRefreshTokens.push(refreshTokenString);\n const tokens = await getOrFetchLikelyValidTokens.call(session, 0, null);\n capturedAccessTokenRefreshTokenIds.push(tokens.accessToken.payload.refresh_token_id);\n return {\n ok: true,\n json: async () => ({ redirect_url: \"https://example.com/handler/oauth-callback?code=handoff-code&state=handoff-state\" }),\n };\n });\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async (refreshToken: unknown) => {\n const refreshTokenString = Reflect.get(refreshToken ?? {}, \"token\");\n if (typeof refreshTokenString !== \"string\") {\n throw new Error(\"Expected refresh token while fetching a new access token.\");\n }\n refreshedRawRefreshTokens.push(refreshTokenString);\n return AccessToken.createIfValid(freshAccessToken) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n\n try {\n const createCrossDomainAuthRedirectUrl = Reflect.get(clientApp, \"_createCrossDomainAuthRedirectUrl\");\n if (typeof createCrossDomainAuthRedirectUrl !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _createCrossDomainAuthRedirectUrl in tests.\");\n }\n\n await expect(createCrossDomainAuthRedirectUrl.call(clientApp, {\n redirectUri: \"https://example.com/handler/oauth-callback\",\n state: \"handoff-state\",\n codeChallenge: \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\",\n afterCallbackRedirectUrl: \"https://example.com/account-settings\",\n overrideTokenStoreInit: {\n accessToken: createAccessTokenString(\"fresh-stale-refresh-token-id\"),\n refreshToken: \"fresh-refresh-token\",\n },\n })).resolves.toBe(\"https://example.com/handler/oauth-callback?code=handoff-code&state=handoff-state\");\n } finally {\n Reflect.set(clientInterface, \"sendClientRequest\", originalSendClientRequest);\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n }\n\n expect(refreshedRawRefreshTokens).toEqual([\"fresh-refresh-token\"]);\n expect(capturedRefreshTokens).toEqual([\"fresh-refresh-token\"]);\n expect(capturedAccessTokenRefreshTokenIds).toEqual([\"fresh-refresh-token-id\"]);\n });\n\n it(\"uses a fresh nested OAuth state while preserving the outer cross-domain return state\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000002\";\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const outerState = \"outer-cross-domain-state\";\n const outerCodeChallenge = \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\";\n const currentUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n currentUrl.searchParams.set(\"after_auth_return_to\", `https://demo.stack-auth.com/?hexclave_cross_domain_auth=1&hexclave_cross_domain_state=${outerState}`);\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", outerState);\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", outerCodeChallenge);\n currentUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", \"https://demo.stack-auth.com/\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-session\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_callback_url\", \"https://demo.stack-auth.com/\");\n\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n let redirectedUrl = \"\";\n vi.spyOn(clientApp as any, \"_fetchCurrentRefreshTokenIdIfSignedIn\").mockResolvedValue(null);\n vi.spyOn(clientApp as any, \"_getCrossDomainHandoffParamsForRedirect\").mockResolvedValue({\n state: \"fresh-nested-state\",\n codeChallenge: \"fresh-nested-code-challenge\",\n });\n vi.spyOn(clientApp as any, \"_isTrusted\").mockResolvedValue(true);\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: currentUrl.toString(),\n replace: (url: string) => {\n redirectedUrl = url;\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n try {\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n const redirectUrl = new URL(redirectedUrl);\n expect(redirectUrl.searchParams.get(\"state\")).toBe(\"fresh-nested-state\");\n expect(redirectUrl.searchParams.get(\"code_challenge\")).toBe(\"fresh-nested-code-challenge\");\n const redirectUri = new URL(redirectUrl.searchParams.get(\"redirect_uri\") ?? \"\");\n expect(redirectUri.searchParams.get(\"hexclave_cross_domain_state\")).toBe(outerState);\n expect(redirectUri.searchParams.get(\"hexclave_cross_domain_code_challenge\")).toBe(outerCodeChallenge);\n expect(redirectUri.searchParams.get(\"hexclave_cross_domain_after_callback_redirect_url\")).toBe(\"https://demo.stack-auth.com/\");\n });\n\n it(\"clears a stale target-domain session before deferring to the source-domain session\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000006\";\n const hostedAccessToken = createAccessTokenString(\"hosted-old-refresh-token-id\");\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const tokenStore = Reflect.get(clientApp, \"_memoryTokenStore\");\n if (!(tokenStore instanceof Store)) {\n throw new Error(\"Expected StackClientApp to use a memory token store in this test.\");\n }\n tokenStore.set({\n refreshToken: \"hosted-old-refresh-token\",\n accessToken: hostedAccessToken,\n });\n\n const currentUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-anonymous-refresh-token-id\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_callback_url\", \"https://demo.stack-auth.com/handler/oauth-callback\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", \"outer-state\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", \"outer-code-challenge\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", \"https://demo.stack-auth.com/app\");\n\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n let redirectedUrl = \"\";\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async () => {\n return AccessToken.createIfValid(hostedAccessToken) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n vi.spyOn(clientApp as any, \"_isTrusted\").mockResolvedValue(true);\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: currentUrl.toString(),\n replace: (url: string) => {\n redirectedUrl = url;\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n try {\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n } finally {\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n expect(tokenStore.get()).toEqual({\n refreshToken: null,\n accessToken: null,\n });\n expect(new URL(redirectedUrl).origin).toBe(\"https://demo.stack-auth.com\");\n });\n\n it(\"uses the latest browser refresh cookie before computing nested cross-domain session IDs\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000007\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: \"https://demo.stack-auth.com/\",\n protocol: \"https:\",\n hostname: \"demo.stack-auth.com\",\n },\n addEventListener: () => {},\n removeEventListener: () => {},\n } as any;\n\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"cookie\",\n redirectMethod: \"none\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n const refreshedRawRefreshTokens: string[] = [];\n\n // Cookie-store writes queue a background trusted-parent-domain lookup. Without this stub, that\n // lookup fetches the (unreachable) baseUrl with retries while holding the global store lock,\n // which starves any later test that needs the write lock (e.g. signOut). Not restored on\n // purpose: queued tasks can still run after this test body finishes.\n vi.spyOn(clientApp as any, \"_getTrustedParentDomain\").mockResolvedValue(null);\n\n try {\n const getBrowserCookieTokenStore = Reflect.get(clientApp, \"_getBrowserCookieTokenStore\");\n if (typeof getBrowserCookieTokenStore !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _getBrowserCookieTokenStore in tests.\");\n }\n const tokenStore = getBrowserCookieTokenStore.call(clientApp);\n tokenStore.set({\n refreshToken: \"old-refresh-token\",\n accessToken: createAccessTokenString(\"old-refresh-token-id\"),\n });\n\n document.cookie = `__Host-hexclave-refresh-${projectId}--default=${JSON.stringify({\n refresh_token: \"new-refresh-token\",\n updated_at_millis: 1,\n })}`;\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async (refreshToken: unknown) => {\n const refreshTokenString = Reflect.get(refreshToken ?? {}, \"token\");\n if (typeof refreshTokenString !== \"string\") {\n throw new Error(\"Expected refresh token while fetching a new access token.\");\n }\n refreshedRawRefreshTokens.push(refreshTokenString);\n return AccessToken.createIfValid(createAccessTokenString(\"new-refresh-token-id\")) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n\n const fetchCurrentRefreshTokenIdIfSignedIn = Reflect.get(clientApp, \"_fetchCurrentRefreshTokenIdIfSignedIn\");\n if (typeof fetchCurrentRefreshTokenIdIfSignedIn !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _fetchCurrentRefreshTokenIdIfSignedIn in tests.\");\n }\n await expect(fetchCurrentRefreshTokenIdIfSignedIn.call(clientApp, {\n awaitPendingAuthResolutions: false,\n })).resolves.toBe(\"new-refresh-token-id\");\n } finally {\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n expect(refreshedRawRefreshTokens).toEqual([\"new-refresh-token\"]);\n });\n\n it(\"does not re-bounce nested cross-domain auth after the OAuth callback consumed code+state from the URL\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000008\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n\n const strippedUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n strippedUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-refresh-token-id\");\n strippedUrl.searchParams.set(\"stack_nested_cross_domain_auth_callback_url\", \"https://demo.stack-auth.com/\");\n const urlAtConstructionTime = new URL(strippedUrl);\n urlAtConstructionTime.searchParams.set(\"code\", \"one-time-code\");\n urlAtConstructionTime.searchParams.set(\"state\", \"nested-oauth-state\");\n\n // Construct before installing the window mock so the constructor does not schedule its own\n // nested-auth resolution; the assertions below drive the handler explicitly.\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: strippedUrl.toString(),\n replace: () => {\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n vi.spyOn(clientApp as any, \"_fetchCurrentRefreshTokenIdIfSignedIn\").mockResolvedValue(null);\n vi.spyOn(clientApp as any, \"_getCrossDomainHandoffParamsForRedirect\").mockResolvedValue({\n state: \"fresh-nested-state\",\n codeChallenge: \"fresh-nested-code-challenge\",\n });\n vi.spyOn(clientApp as any, \"_isTrusted\").mockResolvedValue(true);\n\n try {\n // Without the construction-time URL, the handler re-bounces (location.replace aborts).\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n // With it, the in-flight OAuth callback wins and the handler stands down.\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth(urlAtConstructionTime)).resolves.toBe(false);\n // The live-URL guard must also stand down on its own when code+state are still present.\n (globalThis.window as any).location.href = urlAtConstructionTime.toString();\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).resolves.toBe(false);\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"reports malformed nested cross-domain auth URLs as setup errors\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000012\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n globalThis.document = createMockDocument();\n\n // A URL the flow cannot even parse is as fatal as an untrusted one, so it has to reach the developer the same way\n // instead of escaping as a bare TypeError from `new URL()`, which the overlay only shows during development.\n // The two branches of the handler want opposite session states: on the provider side (a.com) a query-derived failure\n // only becomes a setup error when the handoff belongs to the current session, while the requesting side (b.com) only\n // bounces when the current session is *not* the one that was asked for.\n const malformedCases = [\n {\n description: \"redirect URI\",\n currentRefreshTokenId: \"source-refresh-token-id\",\n params: { redirect_uri: \"not-a-url\", state: \"nested-state\", code_challenge: \"nested-code-challenge\" },\n },\n {\n description: \"after-callback redirect URL\",\n currentRefreshTokenId: \"source-refresh-token-id\",\n params: {\n redirect_uri: \"https://source.example.test/handler/account-settings\",\n state: \"nested-state\",\n code_challenge: \"nested-code-challenge\",\n after_callback_redirect_url: \"http://[\",\n },\n },\n {\n description: \"callback URL\",\n currentRefreshTokenId: null,\n params: { stack_nested_cross_domain_auth_callback_url: \"http://[\" },\n },\n ];\n\n try {\n for (const malformedCase of malformedCases) {\n const currentUrl = new URL(\"https://target.example.test/nested-provider\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-refresh-token-id\");\n for (const [key, value] of Object.entries(malformedCase.params)) {\n currentUrl.searchParams.set(key, value);\n }\n // Each app is constructed with the mock window uninstalled: the constructor's automatic side effects expect a\n // real window, and a construction-time nested-auth URL would also schedule a second, unawaited run of the\n // handler that keeps failing in the background and leaks into whichever test runs next.\n globalThis.window = previousWindow;\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n setMockWindow({ location: { href: currentUrl.toString() } });\n Reflect.set(clientApp, \"_fetchCurrentRefreshTokenIdIfSignedIn\", async () => malformedCase.currentRefreshTokenId);\n Reflect.set(clientApp, \"_isTrusted\", async () => true);\n\n const nestedAuthPromise = callProtectedMethod(clientApp, \"_maybeHandleNestedCrossDomainAuth\");\n await expect(nestedAuthPromise).rejects.toThrowError(new RegExp(`${malformedCase.description} .* is not a valid absolute URL`));\n await expect(nestedAuthPromise).rejects.toSatisfy((error: unknown) => HexclaveSetupError.isSetupError(error));\n }\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"keeps nested cross-domain auth failures off the page for a handoff that does not own the session\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000013\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n globalThis.document = createMockDocument();\n\n // Setup errors are shown in production, so a link anybody can craft must not be able to put a card on a healthy\n // app's page: with a refresh-token ID that is not the current session's, every failure below stays an ordinary error\n // that only captureError sees, even though the same URL from the right session would render a card.\n const craftedRedirectUris = [\n \"https://evil.example.test/handler/account-settings\", // untrusted\n \"not-a-url\", // malformed\n ];\n\n try {\n for (const craftedRedirectUri of craftedRedirectUris) {\n const currentUrl = new URL(\"https://target.example.test/nested-provider\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"attacker-chosen-refresh-token-id\");\n currentUrl.searchParams.set(\"redirect_uri\", craftedRedirectUri);\n currentUrl.searchParams.set(\"state\", \"nested-state\");\n currentUrl.searchParams.set(\"code_challenge\", \"nested-code-challenge\");\n\n globalThis.window = previousWindow;\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n setMockWindow({ location: { href: currentUrl.toString() } });\n Reflect.set(clientApp, \"_fetchCurrentRefreshTokenIdIfSignedIn\", async () => \"this-apps-refresh-token-id\");\n Reflect.set(clientApp, \"_isTrusted\", async () => false);\n\n const nestedAuthPromise = callProtectedMethod(clientApp, \"_maybeHandleNestedCrossDomainAuth\");\n await expect(nestedAuthPromise).rejects.toThrowError(/does not match the requested refresh token ID/);\n await expect(nestedAuthPromise).rejects.toSatisfy(\n (error: unknown) => !HexclaveSetupError.isSetupError(error),\n );\n }\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"passes the construction-time URL to the nested cross-domain auth handler\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000009\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n\n const callbackUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n callbackUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-refresh-token-id\");\n callbackUrl.searchParams.set(\"code\", \"one-time-code\");\n callbackUrl.searchParams.set(\"state\", \"nested-oauth-state\");\n const strippedUrl = new URL(callbackUrl);\n strippedUrl.searchParams.delete(\"code\");\n strippedUrl.searchParams.delete(\"state\");\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: callbackUrl.toString(),\n },\n } as any;\n\n const nestedAuthSpy = vi.spyOn(StackClientApp.prototype as any, \"_maybeHandleNestedCrossDomainAuth\").mockResolvedValue(false);\n\n try {\n new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n // Simulate consumeOAuthCallbackQueryParams stripping code+state before microtasks run.\n (globalThis.window as any).location.href = strippedUrl.toString();\n await new Promise((resolve) => setTimeout(resolve, 0));\n\n expect(nestedAuthSpy).toHaveBeenCalledTimes(1);\n const urlArgument = nestedAuthSpy.mock.calls[0][0] as URL;\n expect(urlArgument).toBeInstanceOf(URL);\n expect(urlArgument.searchParams.get(\"code\")).toBe(\"one-time-code\");\n expect(urlArgument.searchParams.get(\"state\")).toBe(\"nested-oauth-state\");\n } finally {\n nestedAuthSpy.mockRestore();\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"redirects hosted current-page OAuth callback errors to the hosted error handler during startup\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000010\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n const callbackUrl = new URL(\"https://demo.stack-auth.com/dashboard\");\n callbackUrl.searchParams.set(\"errorCode\", \"SIGN_UP_REJECTED\");\n callbackUrl.searchParams.set(\"message\", \"Your sign up was rejected by an administrator's sign-up rule.\");\n callbackUrl.searchParams.set(\"details\", JSON.stringify({\n message: \"Your sign up was rejected by an administrator's sign-up rule.\",\n }));\n callbackUrl.searchParams.set(\"after_auth_return_to\", \"/dashboard\");\n callbackUrl.searchParams.set(\"after_callback_redirect_url\", \"https://customer.example.test/settings?tab=connected-accounts\");\n let currentHref = callbackUrl.toString();\n let redirectedUrl = \"\";\n const redirectSpy = vi.spyOn(StackClientApp.prototype as any, \"_redirectTo\").mockImplementation(async (...args: unknown[]) => {\n const options = args[0] as { url: string | URL };\n redirectedUrl = options.url.toString();\n });\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n get href() {\n return currentHref;\n },\n set href(value: string) {\n currentHref = value;\n },\n origin: callbackUrl.origin,\n },\n history: {\n replaceState: (_state: unknown, _title: string, url: string) => {\n currentHref = new URL(url, currentHref).toString();\n },\n },\n addEventListener: () => {},\n removeEventListener: () => {},\n } as any;\n\n try {\n new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n await new Promise((resolve) => setTimeout(resolve, 0));\n await new Promise((resolve) => setTimeout(resolve, 0));\n } finally {\n redirectSpy.mockRestore();\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n const errorUrl = new URL(redirectedUrl);\n expect(errorUrl.origin).toBe(`https://${projectId}.built-with-hexclave.com`);\n expect(errorUrl.pathname).toBe(\"/handler/error\");\n expect(errorUrl.searchParams.get(\"errorCode\")).toBe(\"SIGN_UP_REJECTED\");\n expect(errorUrl.searchParams.get(\"message\")).toBe(\"Your sign up was rejected by an administrator's sign-up rule.\");\n expect(errorUrl.searchParams.get(\"after_auth_return_to\")).toBe(\"/dashboard\");\n expect(errorUrl.searchParams.get(\"after_callback_redirect_url\")).toBe(\"https://customer.example.test/settings?tab=connected-accounts\");\n expect(new URL(currentHref).searchParams.has(\"errorCode\")).toBe(false);\n });\n\n it(\"uses direct sign-out instead of hosted sign-out redirects when code execution is available\", async () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000003\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n handler: \"/handler\",\n signOut: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const signOutSpy = vi.spyOn(clientApp, \"signOut\").mockRejectedValue(new Error(\"INTENTIONAL_TEST_ABORT\"));\n\n try {\n await expect(clientApp.redirectToSignOut()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n expect(signOutSpy).toHaveBeenCalledWith();\n } finally {\n signOutSpy.mockRestore();\n }\n });\n\n it(\"throws when public app.urls reads would return hosted component URLs\", () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000003\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n expect(() => clientApp.urls.signIn).toThrowError(/app\\.urls\\.signIn cannot be used when this app is configured to use hosted components.*Use app\\.redirectToSignIn\\(\\) instead/s);\n expect(() => clientApp.urls.signOut).toThrowError(/app\\.urls\\.signOut cannot be used when this app is configured to use hosted components.*Use app\\.redirectToSignOut\\(\\) instead/s);\n expect(clientApp.urls.afterSignIn).toBe(\"/\");\n });\n\n it(\"keeps public app.urls reads available for non-hosted targets\", () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000003\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n handler: \"/custom-handler\",\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n expect(clientApp.urls.signIn).toBe(\"/custom-handler/sign-in\");\n });\n\n it(\"keeps default hosted signOut() on the source domain when afterSignOut is not configured\", async () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000004\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const currentHref = \"https://demo.stack-auth.com/settings?tab=profile\";\n\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalSignOut = Reflect.get(clientInterface, \"signOut\");\n Reflect.set(clientInterface, \"signOut\", async () => {});\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n let redirectedUrl = \"\";\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: currentHref,\n replace: (url: string) => {\n redirectedUrl = url;\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n try {\n const signOut = Reflect.get(clientApp, \"_signOut\");\n if (typeof signOut !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _signOut in tests.\");\n }\n await expect(signOut.call(clientApp, Reflect.get(clientInterface, \"createSession\").call(clientInterface, {\n refreshToken: null,\n }))).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n } finally {\n Reflect.set(clientInterface, \"signOut\", originalSignOut);\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n expect(redirectedUrl).toBe(\"/settings?tab=profile\");\n });\n\n it(\"restores a dropped after_auth_return_to from the sessionStorage mirror when redirecting after sign-in\", async () => {\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n const sessionStorageMap = new Map<string, string>();\n const windowMock = {\n location: {\n href: \"https://demo.example.test/handler/sign-in?after_auth_return_to=%2Fmusic%3Ftrack%3D1\",\n },\n sessionStorage: {\n getItem: (key: string) => sessionStorageMap.get(key) ?? null,\n setItem: (key: string, value: string) => {\n sessionStorageMap.set(key, value);\n },\n removeItem: (key: string) => {\n sessionStorageMap.delete(key);\n },\n },\n };\n Reflect.set(globalThis, \"window\", windowMock);\n globalThis.document = createMockDocument();\n\n try {\n // The constructor mirrors the redirect-back state from the arrival URL into sessionStorage.\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000011\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n // Intermediate hops (MFA, magic link, OAuth round-trips, ...) dropped the query params.\n windowMock.location.href = \"https://demo.example.test/handler/mfa\";\n\n const redirectUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"afterSignIn\");\n expect(redirectUrl).toBe(\"/music?track=1\");\n\n // noRedirectBack opts out of the mirror just like it opts out of the query param.\n const noRedirectBackUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"afterSignIn\", { noRedirectBack: true });\n expect(new URL(noRedirectBackUrl, \"https://demo.example.test\").pathname).toBe(\"/\");\n } finally {\n globalThis.document = previousDocument;\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n\n it(\"restores dropped cross-domain handoff state from the sessionStorage mirror when redirecting after sign-in\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000012\";\n const previousWindow = globalThis.window;\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n const sessionStorageMap = new Map<string, string>();\n\n const handoffState = \"mirror-handoff-state\";\n const handoffCodeChallenge = \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\";\n const handoffAfterCallbackRedirect = \"https://demo.example.test/dashboard\";\n const redirectBackUrl = new URL(\"https://demo.example.test/handler/oauth-callback\");\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_auth\", \"1\");\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_state\", handoffState);\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", handoffCodeChallenge);\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", handoffAfterCallbackRedirect);\n\n const arrivalUrl = new URL(`https://${projectId}.built-with-hexclave.com/handler/sign-in`);\n arrivalUrl.searchParams.set(\"after_auth_return_to\", redirectBackUrl.toString());\n arrivalUrl.searchParams.set(\"hexclave_cross_domain_state\", handoffState);\n arrivalUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", handoffCodeChallenge);\n arrivalUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", handoffAfterCallbackRedirect);\n\n const previousDocument = globalThis.document;\n const windowMock = {\n location: {\n href: arrivalUrl.toString(),\n },\n sessionStorage: {\n getItem: (key: string) => sessionStorageMap.get(key) ?? null,\n setItem: (key: string, value: string) => {\n sessionStorageMap.set(key, value);\n },\n removeItem: (key: string) => {\n sessionStorageMap.delete(key);\n },\n },\n };\n Reflect.set(globalThis, \"window\", windowMock);\n globalThis.document = createMockDocument();\n\n try {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const crossDomainAuthorizeRedirect = \"https://demo.example.test/handler/oauth-callback?code=minted-code&state=mirror-handoff-state\";\n const createCrossDomainAuthRedirectUrlSpy = vi\n .spyOn(clientApp as any, \"_createCrossDomainAuthRedirectUrl\")\n .mockResolvedValue(crossDomainAuthorizeRedirect);\n\n // All redirect-back query params were dropped before the after-sign-in redirect.\n windowMock.location.href = `https://${projectId}.built-with-hexclave.com/handler/sign-in`;\n\n const redirectUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"afterSignIn\");\n\n expect(createCrossDomainAuthRedirectUrlSpy).toHaveBeenCalledWith(expect.objectContaining({\n redirectUri: redirectBackUrl.toString(),\n state: handoffState,\n codeChallenge: handoffCodeChallenge,\n afterCallbackRedirectUrl: handoffAfterCallbackRedirect,\n }));\n expect(redirectUrl).toBe(crossDomainAuthorizeRedirect);\n } finally {\n globalThis.document = previousDocument;\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n\n it(\"ignores stale session callbacks after a newer refresh token owns the token store\", async () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000005\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"none\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const oldAccessToken = createAccessTokenString(\"old-refresh-token-id\");\n const refreshedOldAccessToken = createAccessTokenString(\"refreshed-old-refresh-token-id\");\n const newAccessToken = createAccessTokenString(\"new-refresh-token-id\");\n const tokenStore = new Store({\n refreshToken: \"old-refresh-token\",\n accessToken: oldAccessToken,\n });\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async () => {\n return AccessToken.createIfValid(refreshedOldAccessToken) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n\n try {\n const getSessionFromTokenStore = Reflect.get(clientApp, \"_getSessionFromTokenStore\");\n if (typeof getSessionFromTokenStore !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _getSessionFromTokenStore in tests.\");\n }\n const oldSession = getSessionFromTokenStore.call(clientApp, tokenStore);\n tokenStore.set({\n refreshToken: \"new-refresh-token\",\n accessToken: newAccessToken,\n });\n\n await oldSession.fetchNewTokens();\n expect(tokenStore.get()).toEqual({\n refreshToken: \"new-refresh-token\",\n accessToken: newAccessToken,\n });\n\n oldSession.markInvalid();\n expect(tokenStore.get()).toEqual({\n refreshToken: \"new-refresh-token\",\n accessToken: newAccessToken,\n });\n } finally {\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n }\n });\n});\n"],"mappings":";;;;;;;;AAgBA,SAAS,wBAAwB,gBAAgC;CAC/D,MAAM,UAAU,UAAmB,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,SAAS,WAAW;CAC1F,MAAM,aAAa,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;CAC/C,OAAO;EACL,OAAO;GAAE,KAAK;GAAQ,KAAK;EAAM,CAAC;EAClC,OAAO;GACL,KAAK;GACL,KAAK,aAAa;GAClB,KAAK;GACL,KAAK;GACL,KAAK;GACL,YAAY;GACZ,WAAW;GACX,kBAAkB;GAClB,MAAM;GACN,MAAM;GACN,OAAO;GACP,gBAAgB;GAChB,kBAAkB;GAClB,cAAc;GACd,cAAc;GACd,eAAe;GACf,mBAAmB;GACnB,mBAAmB;EACrB,CAAC;EACD;CACF,CAAC,CAAC,KAAK,GAAG;AACZ;AAEA,SAAS,qBAA+B;CACtC,MAAM,4BAAY,IAAI,IAAoB;CAC1C,OAAO;EACL,IAAI,SAAS;GACX,OAAO,CAAC,GAAG,UAAU,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI;EACpF;EACA,IAAI,OAAO,KAAa;GACtB,MAAM,CAAC,aAAa,IAAI,MAAM,GAAG;GACjC,MAAM,UAAU,UAAU,QAAQ,GAAG;GACrC,IAAI,UAAU,GAAG;GACjB,UAAU,IAAI,UAAU,MAAM,GAAG,OAAO,CAAC,CAAC,KAAK,GAAG,UAAU,MAAM,UAAU,CAAC,CAAC,CA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c,uBAAuB,YAAY;IAClE,MAAM,IAAI,MAAM,wCAAwC;GAC1D,EAAA,CAAG;EACL,CAAC;EAED,IAAI;GACF,MAAM,2BAA2B,QAAQ,IAAI,WAAW,2BAA2B;GACnF,IAAI,OAAO,6BAA6B,YACtC,MAAM,IAAI,MAAM,uEAAuE;GAEzF,MAAM,aAAa,yBAAyB,KAAK,WAAW,UAAU;GACtE,WAAW,IAAI;IACb,cAAc;IACd,aAAa;GACf,CAAC;GAED,MAAM,WAAW,eAAe;GAChC,OAAO,WAAW,IAAI,CAAC,CAAC,CAAC,QAAQ;IAC/B,cAAc;IACd,aAAa;GACf,CAAC;GAED,WAAW,YAAY;GACvB,OAAO,WAAW,IAAI,CAAC,CAAC,CAAC,QAAQ;IAC/B,cAAc;IACd,aAAa;GACf,CAAC;EACH,UAAU;GACR,QAAQ,IAAI,iBAAiB,uBAAuB,2BAA2B;EACjF;CACF,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"client-app-impl.cross-domain.test.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { describe, expect, it, vi } from \"vitest\";\nimport { AccessToken } from \"@hexclave/shared/dist/sessions\";\nimport { HexclaveSetupError } from \"@hexclave/shared/dist/utils/errors\";\nimport { Store } from \"@hexclave/shared/dist/utils/stores\";\nimport { hexclaveAppInternalsSymbol } from \"../../common\";\nimport { StackClientApp } from \"../interfaces/client-app\";\nimport { planRedirectToHandler } from \"./redirect-page-urls\";\n\n// Every app in this file is constructed with `devTool: false`. The tests install a mock window and document, which makes\n// the SDK believe it is in a browser; mounting the dev tool would then start background requests against a backend that\n// does not exist here and leak that work across test cases.\nfunction createAccessTokenString(refreshTokenId: string): string {\n const encode = (value: unknown) => Buffer.from(JSON.stringify(value)).toString(\"base64url\");\n const nowSeconds = Math.floor(Date.now() / 1000);\n return [\n encode({ alg: \"none\", typ: \"JWT\" }),\n encode({\n sub: \"user-id\",\n exp: nowSeconds + 60,\n iat: nowSeconds,\n iss: \"https://api.example.test\",\n aud: \"project-id\",\n project_id: \"project-id\",\n branch_id: \"main\",\n refresh_token_id: refreshTokenId,\n role: \"authenticated\",\n name: null,\n email: null,\n email_verified: false,\n selected_team_id: null,\n signed_up_at: nowSeconds,\n is_anonymous: false,\n is_restricted: false,\n restricted_reason: null,\n requires_totp_mfa: false,\n }),\n \"\",\n ].join(\".\");\n}\n\nfunction createMockDocument(): Document {\n const cookieJar = new Map<string, string>();\n return {\n get cookie() {\n return [...cookieJar.entries()].map(([key, value]) => `${key}=${value}`).join(\"; \");\n },\n set cookie(str: string) {\n const [nameValue] = str.split(\";\");\n const eqIndex = nameValue.indexOf(\"=\");\n if (eqIndex < 0) return;\n cookieJar.set(nameValue.slice(0, eqIndex).trim(), nameValue.slice(eqIndex + 1).trim());\n },\n createElement: () => ({}),\n } as any;\n}\n\n/**\n * Installs a stand-in for `window` with only the parts the code under test touches. `globalThis.window` is typed as a\n * full `Window`, which a hand-written stub can never be, so the assignment goes through `Reflect.set` — the stub's own\n * shape stays checked, unlike with a cast on the object literal.\n */\nfunction setMockWindow(mockWindow: {\n location: { href: string, replace?: (url: string) => void },\n}): void {\n Reflect.set(globalThis, \"window\", mockWindow);\n}\n\n/**\n * Calls one of the app's `protected` methods, which are part of the flows under test but not of the public SDK surface.\n */\nfunction callProtectedMethod(app: StackClientApp<true>, methodName: string, ...args: unknown[]): Promise<unknown> {\n const method = Reflect.get(app, methodName);\n if (typeof method !== \"function\") {\n throw new Error(`Expected StackClientApp to have a ${methodName} method in tests.`);\n }\n return method.apply(app, args);\n}\n\ndescribe(\"StackClientApp cross-domain auth\", () => {\n it(\"keeps noRedirectBack same-domain redirects free of redirect-back state\", async () => {\n const redirectPlan = await planRedirectToHandler({\n handlerName: \"signIn\",\n rawHandlerUrl: \"/handler/sign-in\",\n noRedirectBack: true,\n currentUrl: new URL(\"https://app.example.test/settings?tab=profile\"),\n localOAuthCallbackUrl: \"/handler/oauth-callback\",\n rawHomeUrl: \"/home\",\n getCrossDomainHandoffParams: async () => {\n throw new Error(\"Same-domain redirects must not create cross-domain handoff parameters.\");\n },\n });\n\n expect(redirectPlan).toEqual({\n type: \"redirect\",\n url: \"/handler/sign-in\",\n });\n });\n\n it(\"returns noRedirectBack cross-domain auth to the source app home\", async () => {\n const handoffState = \"no-redirect-back-state\";\n const handoffCodeChallenge = \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\";\n const currentUrl = new URL(\"https://app.example.test/settings?tab=profile\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", handoffState);\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", handoffCodeChallenge);\n currentUrl.searchParams.set(\n \"hexclave_cross_domain_after_callback_redirect_url\",\n \"https://app.example.test/settings?tab=profile\",\n );\n\n const redirectPlan = await planRedirectToHandler({\n handlerName: \"signIn\",\n rawHandlerUrl: \"https://auth.example.test/handler/sign-in\",\n noRedirectBack: true,\n currentUrl,\n localOAuthCallbackUrl: \"/handler/oauth-callback\",\n rawHomeUrl: \"/home\",\n getCrossDomainHandoffParams: async () => {\n throw new Error(\"Existing cross-domain handoff parameters must be reused.\");\n },\n });\n\n expect(redirectPlan.type).toBe(\"redirect\");\n if (redirectPlan.type !== \"redirect\") {\n throw new Error(\"Expected noRedirectBack sign-in to produce a redirect URL.\");\n }\n\n const hostedUrl = new URL(redirectPlan.url);\n expect(hostedUrl.origin).toBe(\"https://auth.example.test\");\n expect(hostedUrl.pathname).toBe(\"/handler/sign-in\");\n expect(hostedUrl.searchParams.get(\"hexclave_cross_domain_after_callback_redirect_url\")).toBe(\n \"https://app.example.test/home\",\n );\n\n const rawSourceCallbackUrl = hostedUrl.searchParams.get(\"after_auth_return_to\");\n if (rawSourceCallbackUrl == null) {\n throw new Error(\"Expected cross-domain noRedirectBack to include its internal source callback URL.\");\n }\n const sourceCallbackUrl = new URL(rawSourceCallbackUrl);\n expect(sourceCallbackUrl.origin).toBe(\"https://app.example.test\");\n expect(sourceCallbackUrl.pathname).toBe(\"/handler/oauth-callback\");\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_auth\")).toBe(\"1\");\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_state\")).toBe(handoffState);\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_code_challenge\")).toBe(handoffCodeChallenge);\n expect(sourceCallbackUrl.searchParams.get(\"hexclave_cross_domain_after_callback_redirect_url\")).toBe(\n \"https://app.example.test/home\",\n );\n expect(sourceCallbackUrl.toString()).not.toContain(\"/settings\");\n });\n\n it(\"exposes redirect-back-aware handler URLs for devtool previews\", async () => {\n const previousWindow = Reflect.get(globalThis, \"window\");\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n Reflect.set(globalThis, \"window\", {\n location: {\n href: \"http://localhost/music?track=1#song\",\n },\n });\n\n try {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000000\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"none\",\n urls: {\n signIn: \"/handler/sign-in\",\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n const redirectUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"signIn\");\n\n const resolved = new URL(redirectUrl, \"http://localhost\");\n expect(resolved.pathname).toBe(\"/handler/sign-in\");\n expect(resolved.searchParams.get(\"after_auth_return_to\")).toBe(\"/music?track=1#song\");\n } finally {\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n\n it(\"uses the fresh post-auth refresh token when minting a cross-domain handoff\", async () => {\n const freshAccessToken = createAccessTokenString(\"fresh-refresh-token-id\");\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000000\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: {\n accessToken: createAccessTokenString(\"stale-refresh-token-id\"),\n refreshToken: \"stale-refresh-token\",\n },\n redirectMethod: \"none\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalSendClientRequest = Reflect.get(clientInterface, \"sendClientRequest\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n const capturedRefreshTokens: string[] = [];\n const capturedAccessTokenRefreshTokenIds: string[] = [];\n const refreshedRawRefreshTokens: string[] = [];\n\n Reflect.set(clientInterface, \"sendClientRequest\", async (_path: unknown, _requestOptions: unknown, session: unknown) => {\n const getRefreshToken = Reflect.get(session ?? {}, \"getRefreshToken\");\n const getOrFetchLikelyValidTokens = Reflect.get(session ?? {}, \"getOrFetchLikelyValidTokens\");\n if (typeof getRefreshToken !== \"function\") {\n throw new Error(\"Expected cross-domain auth to pass a session to the client interface.\");\n }\n if (typeof getOrFetchLikelyValidTokens !== \"function\") {\n throw new Error(\"Expected cross-domain auth to pass a session with token accessors.\");\n }\n const refreshToken = getRefreshToken.call(session);\n const refreshTokenString = Reflect.get(refreshToken ?? {}, \"token\");\n if (typeof refreshTokenString !== \"string\") {\n throw new Error(\"Expected cross-domain auth to pass a refresh-token-backed session.\");\n }\n capturedRefreshTokens.push(refreshTokenString);\n const tokens = await getOrFetchLikelyValidTokens.call(session, 0, null);\n capturedAccessTokenRefreshTokenIds.push(tokens.accessToken.payload.refresh_token_id);\n return {\n ok: true,\n json: async () => ({ redirect_url: \"https://example.com/handler/oauth-callback?code=handoff-code&state=handoff-state\" }),\n };\n });\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async (refreshToken: unknown) => {\n const refreshTokenString = Reflect.get(refreshToken ?? {}, \"token\");\n if (typeof refreshTokenString !== \"string\") {\n throw new Error(\"Expected refresh token while fetching a new access token.\");\n }\n refreshedRawRefreshTokens.push(refreshTokenString);\n return AccessToken.createIfValid(freshAccessToken) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n\n try {\n const createCrossDomainAuthRedirectUrl = Reflect.get(clientApp, \"_createCrossDomainAuthRedirectUrl\");\n if (typeof createCrossDomainAuthRedirectUrl !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _createCrossDomainAuthRedirectUrl in tests.\");\n }\n\n await expect(createCrossDomainAuthRedirectUrl.call(clientApp, {\n redirectUri: \"https://example.com/handler/oauth-callback\",\n state: \"handoff-state\",\n codeChallenge: \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\",\n afterCallbackRedirectUrl: \"https://example.com/account-settings\",\n overrideTokenStoreInit: {\n accessToken: createAccessTokenString(\"fresh-stale-refresh-token-id\"),\n refreshToken: \"fresh-refresh-token\",\n },\n })).resolves.toBe(\"https://example.com/handler/oauth-callback?code=handoff-code&state=handoff-state\");\n } finally {\n Reflect.set(clientInterface, \"sendClientRequest\", originalSendClientRequest);\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n }\n\n expect(refreshedRawRefreshTokens).toEqual([\"fresh-refresh-token\"]);\n expect(capturedRefreshTokens).toEqual([\"fresh-refresh-token\"]);\n expect(capturedAccessTokenRefreshTokenIds).toEqual([\"fresh-refresh-token-id\"]);\n });\n\n it(\"uses a fresh nested OAuth state while preserving the outer cross-domain return state\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000002\";\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const outerState = \"outer-cross-domain-state\";\n const outerCodeChallenge = \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\";\n const currentUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n currentUrl.searchParams.set(\"after_auth_return_to\", `https://demo.stack-auth.com/?hexclave_cross_domain_auth=1&hexclave_cross_domain_state=${outerState}`);\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", outerState);\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", outerCodeChallenge);\n currentUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", \"https://demo.stack-auth.com/\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-session\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_callback_url\", \"https://demo.stack-auth.com/\");\n\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n let redirectedUrl = \"\";\n vi.spyOn(clientApp as any, \"_fetchCurrentRefreshTokenIdIfSignedIn\").mockResolvedValue(null);\n vi.spyOn(clientApp as any, \"_getCrossDomainHandoffParamsForRedirect\").mockResolvedValue({\n state: \"fresh-nested-state\",\n codeChallenge: \"fresh-nested-code-challenge\",\n });\n vi.spyOn(clientApp as any, \"_isTrusted\").mockResolvedValue(true);\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: currentUrl.toString(),\n replace: (url: string) => {\n redirectedUrl = url;\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n try {\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n const redirectUrl = new URL(redirectedUrl);\n expect(redirectUrl.searchParams.get(\"state\")).toBe(\"fresh-nested-state\");\n expect(redirectUrl.searchParams.get(\"code_challenge\")).toBe(\"fresh-nested-code-challenge\");\n const redirectUri = new URL(redirectUrl.searchParams.get(\"redirect_uri\") ?? \"\");\n expect(redirectUri.searchParams.get(\"hexclave_cross_domain_state\")).toBe(outerState);\n expect(redirectUri.searchParams.get(\"hexclave_cross_domain_code_challenge\")).toBe(outerCodeChallenge);\n expect(redirectUri.searchParams.get(\"hexclave_cross_domain_after_callback_redirect_url\")).toBe(\"https://demo.stack-auth.com/\");\n });\n\n it(\"clears a stale target-domain session before deferring to the source-domain session\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000006\";\n const hostedAccessToken = createAccessTokenString(\"hosted-old-refresh-token-id\");\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const tokenStore = Reflect.get(clientApp, \"_memoryTokenStore\");\n if (!(tokenStore instanceof Store)) {\n throw new Error(\"Expected StackClientApp to use a memory token store in this test.\");\n }\n tokenStore.set({\n refreshToken: \"hosted-old-refresh-token\",\n accessToken: hostedAccessToken,\n });\n\n const currentUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-anonymous-refresh-token-id\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_callback_url\", \"https://demo.stack-auth.com/handler/oauth-callback\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", \"outer-state\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", \"outer-code-challenge\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", \"https://demo.stack-auth.com/app\");\n\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n let redirectedUrl = \"\";\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async () => {\n return AccessToken.createIfValid(hostedAccessToken) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n vi.spyOn(clientApp as any, \"_isTrusted\").mockResolvedValue(true);\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: currentUrl.toString(),\n replace: (url: string) => {\n redirectedUrl = url;\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n try {\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n } finally {\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n expect(tokenStore.get()).toEqual({\n refreshToken: null,\n accessToken: null,\n });\n expect(new URL(redirectedUrl).origin).toBe(\"https://demo.stack-auth.com\");\n });\n\n it(\"uses the latest browser refresh cookie before computing nested cross-domain session IDs\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000007\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: \"https://demo.stack-auth.com/\",\n protocol: \"https:\",\n hostname: \"demo.stack-auth.com\",\n },\n addEventListener: () => {},\n removeEventListener: () => {},\n } as any;\n\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"cookie\",\n redirectMethod: \"none\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n const refreshedRawRefreshTokens: string[] = [];\n\n // Cookie-store writes queue a background trusted-parent-domain lookup. Without this stub, that\n // lookup fetches the (unreachable) baseUrl with retries while holding the global store lock,\n // which starves any later test that needs the write lock (e.g. signOut). Not restored on\n // purpose: queued tasks can still run after this test body finishes.\n vi.spyOn(clientApp as any, \"_getTrustedParentDomain\").mockResolvedValue(null);\n\n try {\n const getBrowserCookieTokenStore = Reflect.get(clientApp, \"_getBrowserCookieTokenStore\");\n if (typeof getBrowserCookieTokenStore !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _getBrowserCookieTokenStore in tests.\");\n }\n const tokenStore = getBrowserCookieTokenStore.call(clientApp);\n tokenStore.set({\n refreshToken: \"old-refresh-token\",\n accessToken: createAccessTokenString(\"old-refresh-token-id\"),\n });\n\n document.cookie = `__Host-hexclave-refresh-${projectId}--default=${JSON.stringify({\n refresh_token: \"new-refresh-token\",\n updated_at_millis: 1,\n })}`;\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async (refreshToken: unknown) => {\n const refreshTokenString = Reflect.get(refreshToken ?? {}, \"token\");\n if (typeof refreshTokenString !== \"string\") {\n throw new Error(\"Expected refresh token while fetching a new access token.\");\n }\n refreshedRawRefreshTokens.push(refreshTokenString);\n return AccessToken.createIfValid(createAccessTokenString(\"new-refresh-token-id\")) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n\n const fetchCurrentRefreshTokenIdIfSignedIn = Reflect.get(clientApp, \"_fetchCurrentRefreshTokenIdIfSignedIn\");\n if (typeof fetchCurrentRefreshTokenIdIfSignedIn !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _fetchCurrentRefreshTokenIdIfSignedIn in tests.\");\n }\n await expect(fetchCurrentRefreshTokenIdIfSignedIn.call(clientApp, {\n awaitPendingAuthResolutions: false,\n })).resolves.toBe(\"new-refresh-token-id\");\n } finally {\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n expect(refreshedRawRefreshTokens).toEqual([\"new-refresh-token\"]);\n });\n\n it(\"does not re-bounce nested cross-domain auth after the OAuth callback consumed code+state from the URL\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000008\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n\n const strippedUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n strippedUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-refresh-token-id\");\n strippedUrl.searchParams.set(\"stack_nested_cross_domain_auth_callback_url\", \"https://demo.stack-auth.com/\");\n const urlAtConstructionTime = new URL(strippedUrl);\n urlAtConstructionTime.searchParams.set(\"code\", \"one-time-code\");\n urlAtConstructionTime.searchParams.set(\"state\", \"nested-oauth-state\");\n\n // Construct before installing the window mock so the constructor does not schedule its own\n // nested-auth resolution; the assertions below drive the handler explicitly.\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: strippedUrl.toString(),\n replace: () => {\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n vi.spyOn(clientApp as any, \"_fetchCurrentRefreshTokenIdIfSignedIn\").mockResolvedValue(null);\n vi.spyOn(clientApp as any, \"_getCrossDomainHandoffParamsForRedirect\").mockResolvedValue({\n state: \"fresh-nested-state\",\n codeChallenge: \"fresh-nested-code-challenge\",\n });\n vi.spyOn(clientApp as any, \"_isTrusted\").mockResolvedValue(true);\n\n try {\n // Without the construction-time URL, the handler re-bounces (location.replace aborts).\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n // With it, the in-flight OAuth callback wins and the handler stands down.\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth(urlAtConstructionTime)).resolves.toBe(false);\n // The live-URL guard must also stand down on its own when code+state are still present.\n (globalThis.window as any).location.href = urlAtConstructionTime.toString();\n await expect((clientApp as any)._maybeHandleNestedCrossDomainAuth()).resolves.toBe(false);\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"reports malformed nested cross-domain auth URLs as setup errors\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000012\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n globalThis.document = createMockDocument();\n\n // A URL the flow cannot even parse is as fatal as an untrusted one, so it has to reach the developer the same way\n // instead of escaping as a bare TypeError from `new URL()`, which the overlay only shows during development.\n // The two branches of the handler want opposite session states: on the provider side (a.com) a query-derived failure\n // only becomes a setup error when the handoff belongs to the current session, while the requesting side (b.com) only\n // bounces when the current session is *not* the one that was asked for.\n const malformedCases = [\n {\n description: \"redirect URI\",\n currentRefreshTokenId: \"source-refresh-token-id\",\n params: { redirect_uri: \"not-a-url\", state: \"nested-state\", code_challenge: \"nested-code-challenge\" },\n },\n {\n description: \"after-callback redirect URL\",\n currentRefreshTokenId: \"source-refresh-token-id\",\n params: {\n redirect_uri: \"https://source.example.test/handler/account-settings\",\n state: \"nested-state\",\n code_challenge: \"nested-code-challenge\",\n after_callback_redirect_url: \"http://[\",\n },\n },\n {\n description: \"callback URL\",\n currentRefreshTokenId: null,\n params: { stack_nested_cross_domain_auth_callback_url: \"http://[\" },\n },\n ];\n\n try {\n for (const malformedCase of malformedCases) {\n const currentUrl = new URL(\"https://target.example.test/nested-provider\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-refresh-token-id\");\n for (const [key, value] of Object.entries(malformedCase.params)) {\n currentUrl.searchParams.set(key, value);\n }\n // Each app is constructed with the mock window uninstalled: the constructor's automatic side effects expect a\n // real window, and a construction-time nested-auth URL would also schedule a second, unawaited run of the\n // handler that keeps failing in the background and leaks into whichever test runs next.\n globalThis.window = previousWindow;\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n setMockWindow({ location: { href: currentUrl.toString() } });\n Reflect.set(clientApp, \"_fetchCurrentRefreshTokenIdIfSignedIn\", async () => malformedCase.currentRefreshTokenId);\n Reflect.set(clientApp, \"_isTrusted\", async () => true);\n\n const nestedAuthPromise = callProtectedMethod(clientApp, \"_maybeHandleNestedCrossDomainAuth\");\n await expect(nestedAuthPromise).rejects.toThrowError(new RegExp(`${malformedCase.description} .* is not a valid absolute URL`));\n await expect(nestedAuthPromise).rejects.toSatisfy((error: unknown) => HexclaveSetupError.isSetupError(error));\n }\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"keeps nested cross-domain auth failures off the page for a handoff that does not own the session\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000013\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n globalThis.document = createMockDocument();\n\n // Setup errors are shown in production, so a link anybody can craft must not be able to put a card on a healthy\n // app's page: with a refresh-token ID that is not the current session's, every failure below stays an ordinary error\n // that only captureError sees, even though the same URL from the right session would render a card.\n const craftedRedirectUris = [\n \"https://evil.example.test/handler/account-settings\", // untrusted\n \"not-a-url\", // malformed\n ];\n\n try {\n for (const craftedRedirectUri of craftedRedirectUris) {\n const currentUrl = new URL(\"https://target.example.test/nested-provider\");\n currentUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"attacker-chosen-refresh-token-id\");\n currentUrl.searchParams.set(\"redirect_uri\", craftedRedirectUri);\n currentUrl.searchParams.set(\"state\", \"nested-state\");\n currentUrl.searchParams.set(\"code_challenge\", \"nested-code-challenge\");\n\n globalThis.window = previousWindow;\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n setMockWindow({ location: { href: currentUrl.toString() } });\n Reflect.set(clientApp, \"_fetchCurrentRefreshTokenIdIfSignedIn\", async () => \"this-apps-refresh-token-id\");\n Reflect.set(clientApp, \"_isTrusted\", async () => false);\n\n const nestedAuthPromise = callProtectedMethod(clientApp, \"_maybeHandleNestedCrossDomainAuth\");\n await expect(nestedAuthPromise).rejects.toThrowError(/does not match the requested refresh token ID/);\n await expect(nestedAuthPromise).rejects.toSatisfy(\n (error: unknown) => !HexclaveSetupError.isSetupError(error),\n );\n }\n } finally {\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"passes the construction-time URL to the nested cross-domain auth handler\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000009\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n\n const callbackUrl = new URL(`https://${projectId}.example-stack-hosted.test/handler/sign-in`);\n callbackUrl.searchParams.set(\"stack_nested_cross_domain_auth_refresh_token_id\", \"source-refresh-token-id\");\n callbackUrl.searchParams.set(\"code\", \"one-time-code\");\n callbackUrl.searchParams.set(\"state\", \"nested-oauth-state\");\n const strippedUrl = new URL(callbackUrl);\n strippedUrl.searchParams.delete(\"code\");\n strippedUrl.searchParams.delete(\"state\");\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: callbackUrl.toString(),\n },\n } as any;\n\n const nestedAuthSpy = vi.spyOn(StackClientApp.prototype as any, \"_maybeHandleNestedCrossDomainAuth\").mockResolvedValue(false);\n\n try {\n new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n // Simulate consumeOAuthCallbackQueryParams stripping code+state before microtasks run.\n (globalThis.window as any).location.href = strippedUrl.toString();\n await new Promise((resolve) => setTimeout(resolve, 0));\n\n expect(nestedAuthSpy).toHaveBeenCalledTimes(1);\n const urlArgument = nestedAuthSpy.mock.calls[0][0] as URL;\n expect(urlArgument).toBeInstanceOf(URL);\n expect(urlArgument.searchParams.get(\"code\")).toBe(\"one-time-code\");\n expect(urlArgument.searchParams.get(\"state\")).toBe(\"nested-oauth-state\");\n } finally {\n nestedAuthSpy.mockRestore();\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n });\n\n it(\"redirects hosted current-page OAuth callback errors to the hosted error handler during startup\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000010\";\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n const callbackUrl = new URL(\"https://demo.stack-auth.com/dashboard\");\n callbackUrl.searchParams.set(\"errorCode\", \"SIGN_UP_REJECTED\");\n callbackUrl.searchParams.set(\"message\", \"Your sign up was rejected by an administrator's sign-up rule.\");\n callbackUrl.searchParams.set(\"details\", JSON.stringify({\n message: \"Your sign up was rejected by an administrator's sign-up rule.\",\n }));\n callbackUrl.searchParams.set(\"after_auth_return_to\", \"/dashboard\");\n callbackUrl.searchParams.set(\"after_callback_redirect_url\", \"https://customer.example.test/settings?tab=connected-accounts\");\n let currentHref = callbackUrl.toString();\n let redirectedUrl = \"\";\n const redirectSpy = vi.spyOn(StackClientApp.prototype as any, \"_redirectTo\").mockImplementation(async (...args: unknown[]) => {\n const options = args[0] as { url: string | URL };\n redirectedUrl = options.url.toString();\n });\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n get href() {\n return currentHref;\n },\n set href(value: string) {\n currentHref = value;\n },\n origin: callbackUrl.origin,\n },\n history: {\n replaceState: (_state: unknown, _title: string, url: string) => {\n currentHref = new URL(url, currentHref).toString();\n },\n },\n addEventListener: () => {},\n removeEventListener: () => {},\n } as any;\n\n try {\n new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n await new Promise((resolve) => setTimeout(resolve, 0));\n await new Promise((resolve) => setTimeout(resolve, 0));\n } finally {\n redirectSpy.mockRestore();\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n const errorUrl = new URL(redirectedUrl);\n expect(errorUrl.origin).toBe(`https://${projectId}.built-with-hexclave.com`);\n expect(errorUrl.pathname).toBe(\"/handler/error\");\n expect(errorUrl.searchParams.get(\"errorCode\")).toBe(\"SIGN_UP_REJECTED\");\n expect(errorUrl.searchParams.get(\"message\")).toBe(\"Your sign up was rejected by an administrator's sign-up rule.\");\n expect(errorUrl.searchParams.get(\"after_auth_return_to\")).toBe(\"/dashboard\");\n expect(errorUrl.searchParams.get(\"after_callback_redirect_url\")).toBe(\"https://customer.example.test/settings?tab=connected-accounts\");\n expect(new URL(currentHref).searchParams.has(\"errorCode\")).toBe(false);\n });\n\n it(\"uses direct sign-out instead of hosted sign-out redirects when code execution is available\", async () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000003\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n handler: \"/handler\",\n signOut: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const signOutSpy = vi.spyOn(clientApp, \"signOut\").mockRejectedValue(new Error(\"INTENTIONAL_TEST_ABORT\"));\n\n try {\n await expect(clientApp.redirectToSignOut()).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n expect(signOutSpy).toHaveBeenCalledWith();\n } finally {\n signOutSpy.mockRestore();\n }\n });\n\n it(\"throws when public app.urls reads would return hosted component URLs\", () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000003\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n expect(() => clientApp.urls.signIn).toThrowError(/app\\.urls\\.signIn cannot be used when this app is configured to use hosted components.*Use app\\.redirectToSignIn\\(\\) instead/s);\n expect(() => clientApp.urls.signOut).toThrowError(/app\\.urls\\.signOut cannot be used when this app is configured to use hosted components.*Use app\\.redirectToSignOut\\(\\) instead/s);\n expect(clientApp.urls.afterSignIn).toBe(\"/\");\n });\n\n it(\"keeps public app.urls reads available for non-hosted targets\", () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000003\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n handler: \"/custom-handler\",\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n expect(clientApp.urls.signIn).toBe(\"/custom-handler/sign-in\");\n });\n\n it(\"keeps default hosted signOut() on the source domain when afterSignOut is not configured\", async () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000004\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n urls: {\n default: { type: \"hosted\" },\n },\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const currentHref = \"https://demo.stack-auth.com/settings?tab=profile\";\n\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalSignOut = Reflect.get(clientInterface, \"signOut\");\n Reflect.set(clientInterface, \"signOut\", async () => {});\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n let redirectedUrl = \"\";\n\n globalThis.document = createMockDocument();\n globalThis.window = {\n location: {\n href: currentHref,\n replace: (url: string) => {\n redirectedUrl = url;\n throw new Error(\"INTENTIONAL_TEST_ABORT\");\n },\n },\n } as any;\n\n try {\n const signOut = Reflect.get(clientApp, \"_signOut\");\n if (typeof signOut !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _signOut in tests.\");\n }\n await expect(signOut.call(clientApp, Reflect.get(clientInterface, \"createSession\").call(clientInterface, {\n refreshToken: null,\n }))).rejects.toThrowError(\"INTENTIONAL_TEST_ABORT\");\n } finally {\n Reflect.set(clientInterface, \"signOut\", originalSignOut);\n globalThis.window = previousWindow;\n globalThis.document = previousDocument;\n }\n\n expect(redirectedUrl).toBe(\"/settings?tab=profile\");\n });\n\n it(\"restores a dropped after_auth_return_to from the sessionStorage mirror when redirecting after sign-in\", async () => {\n const previousWindow = globalThis.window;\n const previousDocument = globalThis.document;\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n const sessionStorageMap = new Map<string, string>();\n const windowMock = {\n location: {\n href: \"https://demo.example.test/handler/sign-in?after_auth_return_to=%2Fmusic%3Ftrack%3D1\",\n },\n sessionStorage: {\n getItem: (key: string) => sessionStorageMap.get(key) ?? null,\n setItem: (key: string, value: string) => {\n sessionStorageMap.set(key, value);\n },\n removeItem: (key: string) => {\n sessionStorageMap.delete(key);\n },\n },\n };\n Reflect.set(globalThis, \"window\", windowMock);\n globalThis.document = createMockDocument();\n\n try {\n // The constructor mirrors the redirect-back state from the arrival URL into sessionStorage.\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000011\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n\n // Intermediate hops (MFA, magic link, OAuth round-trips, ...) dropped the query params.\n windowMock.location.href = \"https://demo.example.test/handler/mfa\";\n\n const redirectUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"afterSignIn\");\n expect(redirectUrl).toBe(\"/music?track=1\");\n\n // noRedirectBack opts out of the mirror just like it opts out of the query param.\n const noRedirectBackUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"afterSignIn\", { noRedirectBack: true });\n expect(new URL(noRedirectBackUrl, \"https://demo.example.test\").pathname).toBe(\"/\");\n } finally {\n globalThis.document = previousDocument;\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n\n it(\"restores dropped cross-domain handoff state from the sessionStorage mirror when redirecting after sign-in\", async () => {\n const projectId = \"00000000-0000-4000-8000-000000000012\";\n const previousWindow = globalThis.window;\n const hadPreviousWindow = Reflect.has(globalThis, \"window\");\n const sessionStorageMap = new Map<string, string>();\n\n const handoffState = \"mirror-handoff-state\";\n const handoffCodeChallenge = \"abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~\";\n const handoffAfterCallbackRedirect = \"https://demo.example.test/dashboard\";\n const redirectBackUrl = new URL(\"https://demo.example.test/handler/oauth-callback\");\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_auth\", \"1\");\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_state\", handoffState);\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", handoffCodeChallenge);\n redirectBackUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", handoffAfterCallbackRedirect);\n\n const arrivalUrl = new URL(`https://${projectId}.built-with-hexclave.com/handler/sign-in`);\n arrivalUrl.searchParams.set(\"after_auth_return_to\", redirectBackUrl.toString());\n arrivalUrl.searchParams.set(\"hexclave_cross_domain_state\", handoffState);\n arrivalUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", handoffCodeChallenge);\n arrivalUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", handoffAfterCallbackRedirect);\n\n const previousDocument = globalThis.document;\n const windowMock = {\n location: {\n href: arrivalUrl.toString(),\n },\n sessionStorage: {\n getItem: (key: string) => sessionStorageMap.get(key) ?? null,\n setItem: (key: string, value: string) => {\n sessionStorageMap.set(key, value);\n },\n removeItem: (key: string) => {\n sessionStorageMap.delete(key);\n },\n },\n };\n Reflect.set(globalThis, \"window\", windowMock);\n globalThis.document = createMockDocument();\n\n try {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId,\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"window\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const crossDomainAuthorizeRedirect = \"https://demo.example.test/handler/oauth-callback?code=minted-code&state=mirror-handoff-state\";\n const createCrossDomainAuthRedirectUrlSpy = vi\n .spyOn(clientApp as any, \"_createCrossDomainAuthRedirectUrl\")\n .mockResolvedValue(crossDomainAuthorizeRedirect);\n\n // All redirect-back query params were dropped before the after-sign-in redirect.\n windowMock.location.href = `https://${projectId}.built-with-hexclave.com/handler/sign-in`;\n\n const redirectUrl = await clientApp[hexclaveAppInternalsSymbol].getRedirectToHandlerUrl(\"afterSignIn\");\n\n expect(createCrossDomainAuthRedirectUrlSpy).toHaveBeenCalledWith(expect.objectContaining({\n redirectUri: redirectBackUrl.toString(),\n state: handoffState,\n codeChallenge: handoffCodeChallenge,\n afterCallbackRedirectUrl: handoffAfterCallbackRedirect,\n }));\n expect(redirectUrl).toBe(crossDomainAuthorizeRedirect);\n } finally {\n globalThis.document = previousDocument;\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n }\n });\n\n it(\"ignores stale session callbacks after a newer refresh token owns the token store\", async () => {\n const clientApp = new StackClientApp({\n baseUrl: \"http://localhost:12345\",\n projectId: \"00000000-0000-4000-8000-000000000005\",\n publishableClientKey: \"stack-pk-test\",\n tokenStore: \"memory\",\n redirectMethod: \"none\",\n noAutomaticPrefetch: true,\n devTool: false,\n });\n const oldAccessToken = createAccessTokenString(\"old-refresh-token-id\");\n const refreshedOldAccessToken = createAccessTokenString(\"refreshed-old-refresh-token-id\");\n const newAccessToken = createAccessTokenString(\"new-refresh-token-id\");\n const tokenStore = new Store({\n refreshToken: \"old-refresh-token\",\n accessToken: oldAccessToken,\n });\n const clientInterface = Reflect.get(clientApp, \"_interface\");\n const originalFetchNewAccessToken = Reflect.get(clientInterface, \"fetchNewAccessToken\");\n Reflect.set(clientInterface, \"fetchNewAccessToken\", async () => {\n return AccessToken.createIfValid(refreshedOldAccessToken) ?? (() => {\n throw new Error(\"Expected test access token to be valid\");\n })();\n });\n\n try {\n const getSessionFromTokenStore = Reflect.get(clientApp, \"_getSessionFromTokenStore\");\n if (typeof getSessionFromTokenStore !== \"function\") {\n throw new Error(\"Expected StackClientApp to expose _getSessionFromTokenStore in tests.\");\n }\n const oldSession = getSessionFromTokenStore.call(clientApp, tokenStore);\n tokenStore.set({\n refreshToken: \"new-refresh-token\",\n accessToken: newAccessToken,\n });\n\n await oldSession.fetchNewTokens();\n expect(tokenStore.get()).toEqual({\n refreshToken: \"new-refresh-token\",\n accessToken: newAccessToken,\n });\n\n oldSession.markInvalid();\n expect(tokenStore.get()).toEqual({\n refreshToken: \"new-refresh-token\",\n accessToken: newAccessToken,\n });\n } finally {\n Reflect.set(clientInterface, \"fetchNewAccessToken\", originalFetchNewAccessToken);\n }\n });\n});\n"],"mappings":";;;;;;;;AAeA,SAAS,wBAAwB,gBAAgC;CAC/D,MAAM,UAAU,UAAmB,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,SAAS,WAAW;CAC1F,MAAM,aAAa,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;CAC/C,OAAO;EACL,OAAO;GAAE,KAAK;GAAQ,KAAK;EAAM,CAAC;EAClC,OAAO;GACL,KAAK;GACL,KAAK,aAAa;GAClB,KAAK;GACL,KAAK;GACL,KAAK;GACL,YAAY;GACZ,WAAW;GACX,kBAAkB;GAClB,MAAM;GACN,MAAM;GACN,OAAO;GACP,gBAAgB;GAChB,kBAAkB;GAClB,cAAc;GACd,cAAc;GACd,eAAe;GACf,mBAAmB;GACnB,mBAAmB;EACrB,CAAC;EACD;CACF,CAAC,CAAC,KAAK,GAAG;AACZ;AAEA,SAAS,qBAA+B;CACtC,MAAM,4BAAY,IAAI,IAAoB;CAC1C,OAAO;EACL,IAAI,SAAS;GACX,OAAO,CAAC,GAAG,UAAU,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI;EACpF;EACA,IAAI,OAAO,KAAa;GACtB,MAAM,CAA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Ac;GACd,aAAa;EACf,CAAC;EACD,MAAM,kBAAkB,QAAQ,IAAI,WAAW,YAAY;EAC3D,MAAM,8BAA8B,QAAQ,IAAI,iBAAiB,qBAAqB;EACtF,QAAQ,IAAI,iBAAiB,uBAAuB,YAAY;GAC9D,OAAO,YAAY,cAAc,uBAAuB,YAAY;IAClE,MAAM,IAAI,MAAM,wCAAwC;GAC1D,EAAA,CAAG;EACL,CAAC;EAED,IAAI;GACF,MAAM,2BAA2B,QAAQ,IAAI,WAAW,2BAA2B;GACnF,IAAI,OAAO,6BAA6B,YACtC,MAAM,IAAI,MAAM,uEAAuE;GAEzF,MAAM,aAAa,yBAAyB,KAAK,WAAW,UAAU;GACtE,WAAW,IAAI;IACb,cAAc;IACd,aAAa;GACf,CAAC;GAED,MAAM,WAAW,eAAe;GAChC,OAAO,WAAW,IAAI,CAAC,CAAC,CAAC,QAAQ;IAC/B,cAAc;IACd,aAAa;GACf,CAAC;GAED,WAAW,YAAY;GACvB,OAAO,WAAW,IAAI,CAAC,CAAC,CAAC,QAAQ;IAC/B,cAAc;IACd,aAAa;GACf,CAAC;EACH,UAAU;GACR,QAAQ,IAAI,iBAAiB,uBAAuB,2BAA2B;EACjF;CACF,CAAC;AACH,CAAC"}
|
|
@@ -40,6 +40,7 @@ import { Customer, CustomerBilling, CustomerInvoicesList, CustomerInvoicesReques
|
|
|
40
40
|
import { NotificationCategory } from "../../notification-categories/index.js";
|
|
41
41
|
|
|
42
42
|
//#region src/lib/hexclave-app/apps/implementations/client-app-impl.d.ts
|
|
43
|
+
declare function stripBrowserActionQueryParam(): void;
|
|
43
44
|
type HexclaveClientAppImplConstructorOptionsResolved<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & {
|
|
44
45
|
inheritsFrom?: undefined;
|
|
45
46
|
};
|
|
@@ -69,6 +70,7 @@ declare class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pr
|
|
|
69
70
|
private readonly _analyticsOptions;
|
|
70
71
|
private _sessionRecorder;
|
|
71
72
|
private _eventTracker;
|
|
73
|
+
private _pendingSignOut;
|
|
72
74
|
private __DEMO_ENABLE_SLIGHT_FETCH_DELAY;
|
|
73
75
|
private readonly _ownedAdminApps;
|
|
74
76
|
private readonly _currentUserCache;
|
|
@@ -593,8 +595,8 @@ declare class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pr
|
|
|
593
595
|
addRequestListener: (listener: RequestListener) => () => void;
|
|
594
596
|
sendRequest: (path: string, requestOptions: RequestInit, requestType?: "client" | "server" | "admin") => Promise<Response & {
|
|
595
597
|
usedTokens: {
|
|
596
|
-
accessToken: import("@hexclave/shared/dist/sessions-
|
|
597
|
-
refreshToken: import("@hexclave/shared/dist/sessions-
|
|
598
|
+
accessToken: import("@hexclave/shared/dist/sessions-CljaxQdd").t;
|
|
599
|
+
refreshToken: import("@hexclave/shared/dist/sessions-CljaxQdd").i | null;
|
|
598
600
|
} | null;
|
|
599
601
|
}>;
|
|
600
602
|
getUrls: () => Readonly<ResolvedHandlerUrls$1>;
|
|
@@ -615,5 +617,5 @@ declare class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pr
|
|
|
615
617
|
};
|
|
616
618
|
}
|
|
617
619
|
//#endregion
|
|
618
|
-
export { _HexclaveClientAppImplIncomplete };
|
|
620
|
+
export { _HexclaveClientAppImplIncomplete, stripBrowserActionQueryParam };
|
|
619
621
|
//# sourceMappingURL=client-app-impl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app-impl.d.ts","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/client-app-impl.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4RK,+CAAA,4DAA2G,gCAAA,CAAiC,aAAA,EAAe,SAAA;EAAe,YAAA;AAAA;AAAA,cAElK,gCAAA,8EAA8G,cAAA,CAAe,aAAA,EAAe,SAAA;EAFrG;;;;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