@hexclave/next 1.0.73 → 1.0.75
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-D867jXHk.d.ts → admin-app-impl-sTQD2d-3.d.ts} +16 -10
- package/dist/admin-app-impl-sTQD2d-3.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-B931IBrx.d.ts → client-app-BCT5p_70.d.ts} +11 -3
- package/dist/{client-app-B931IBrx.d.ts.map → client-app-BCT5p_70.d.ts.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/oauth-callback.js +3 -18
- package/dist/components-page/oauth-callback.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-page/oauth-callback.d.ts.map +1 -1
- package/dist/esm/components-page/oauth-callback.js +4 -19
- package/dist/esm/components-page/oauth-callback.js.map +1 -1
- package/dist/esm/lib/auth.d.ts.map +1 -1
- package/dist/esm/lib/auth.js +1 -1
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/auth.test.js +2 -2
- package/dist/esm/lib/auth.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +7 -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.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js +102 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +57 -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 +7 -4
- 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 +44 -12
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts +13 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.js +15 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.test.js +25 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.js +67 -12
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js +87 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +9 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/utils/url.js +10 -2
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/esm/utils/url.test.d.ts +1 -0
- package/dist/esm/utils/url.test.js +28 -0
- package/dist/esm/utils/url.test.js.map +1 -0
- package/dist/{hexclave-provider-DkFUT3Fa.d.ts → hexclave-provider-BKxi3Vy-.d.ts} +2 -2
- package/dist/{hexclave-provider-DkFUT3Fa.d.ts.map → hexclave-provider-BKxi3Vy-.d.ts.map} +1 -1
- package/dist/{hooks-4PMrTtJr.d.ts → hooks-CUe5bc3s.d.ts} +2 -2
- package/dist/{hooks-4PMrTtJr.d.ts.map → hooks-CUe5bc3s.d.ts.map} +1 -1
- package/dist/{index-C9bAeWRr.d.ts → index-CvB7XacB.d.ts} +2 -2
- package/dist/{index-C9bAeWRr.d.ts.map → index-CvB7XacB.d.ts.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +1 -1
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/auth.test.js +2 -2
- package/dist/lib/auth.test.js.map +1 -1
- 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.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js +101 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +57 -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 +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +43 -11
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts +13 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.js +15 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.test.js +24 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.js +67 -12
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js +86 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +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/client-app.js.map +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/users/index.d.ts +1 -1
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/oauth-callback-tCVTRbF2.d.ts.map +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/pushed-config-error-overlay/index.d.ts +1 -1
- package/dist/{redirect-page-urls-NUHUchgR.d.ts → redirect-page-urls-BEWG0AtP.d.ts} +2 -1
- package/dist/redirect-page-urls-BEWG0AtP.d.ts.map +1 -0
- package/dist/utils/url.js +10 -2
- package/dist/utils/url.js.map +1 -1
- package/dist/utils/url.test.d.ts +1 -0
- package/dist/utils/url.test.js +27 -0
- package/dist/utils/url.test.js.map +1 -0
- package/package.json +4 -4
- package/src/components-page/oauth-callback.tsx +0 -16
- package/src/lib/auth.test.ts +2 -2
- package/src/lib/auth.ts +3 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts +126 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts +75 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +73 -16
- package/src/lib/hexclave-app/apps/implementations/redirect-back-state.test.ts +29 -1
- package/src/lib/hexclave-app/apps/implementations/redirect-back-state.ts +17 -0
- package/src/lib/hexclave-app/apps/implementations/redirect-page-urls.test.ts +119 -0
- package/src/lib/hexclave-app/apps/implementations/redirect-page-urls.ts +104 -12
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +12 -2
- package/src/utils/url.test.ts +54 -0
- package/src/utils/url.ts +12 -3
- package/dist/admin-app-impl-D867jXHk.d.ts.map +0 -1
- package/dist/redirect-page-urls-NUHUchgR.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _HexclaveServerAppImplIncomplete } from "../../../../admin-app-impl-
|
|
1
|
+
import { n as _HexclaveServerAppImplIncomplete } from "../../../../admin-app-impl-sTQD2d-3.js";
|
|
2
2
|
export { _HexclaveServerAppImplIncomplete };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as StackServerAppConstructor, D as HexclaveAdminApp, F as StackAdminAppConstructorOptions, I as HexclaveServerApp, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, k as HexclaveAdminAppConstructorOptions, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, z as StackServerApp } from "../../../client-app-
|
|
1
|
+
import { B as StackServerAppConstructor, D as HexclaveAdminApp, F as StackAdminAppConstructorOptions, I as HexclaveServerApp, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, k as HexclaveAdminAppConstructorOptions, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, z as StackServerApp } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { HexclaveAdminApp, type HexclaveAdminAppConstructor, type HexclaveAdminAppConstructorOptions, HexclaveClientApp, type HexclaveClientAppConstructor, type HexclaveClientAppConstructorOptions, type HexclaveClientAppJson, HexclaveServerApp, type HexclaveServerAppConstructor, type HexclaveServerAppConstructorOptions, StackAdminApp, type StackAdminAppConstructor, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructor, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructor, type StackServerAppConstructorOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as AdminWorkflowRunState, c as AdminWorkflowStepAttempt, d as AdminWorkflowUpgradeResult, f as AdminWorkflowVersion, i as AdminWorkflowRunDetails, l as AdminWorkflowSyncResult, n as AdminWorkflowDivergenceDiagnostic, o as AdminWorkflowRunsFilter, r as AdminWorkflowRun, s as AdminWorkflowStep, t as AdminWorkflow, u as AdminWorkflowTrigger } from "../../../../workflows-DEb7pIuQ.js";
|
|
2
|
-
import { A as ManagedEmailProviderListItem, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, M as ManagedEmailProviderStatus, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, T as EmailOutboxListResult, j as ManagedEmailProviderSetupResult, k as HexclaveAdminAppConstructorOptions, w as EmailOutboxListOptions } from "../../../../client-app-
|
|
2
|
+
import { A as ManagedEmailProviderListItem, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, M as ManagedEmailProviderStatus, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, T as EmailOutboxListResult, j as ManagedEmailProviderSetupResult, k as HexclaveAdminAppConstructorOptions, w as EmailOutboxListOptions } from "../../../../client-app-BCT5p_70.js";
|
|
3
3
|
import { a as ListSessionReplaysOptions, i as ListSessionReplayChunksResult, n as AdminSessionReplayChunk, o as ListSessionReplaysResult, r as ListSessionReplayChunksOptions, s as SessionReplayAllEventsResult, t as AdminSessionReplay } from "../../../../index-hYjsGKNc.js";
|
|
4
4
|
export { type AdminSessionReplay, type AdminSessionReplayChunk, type AdminWorkflow, type AdminWorkflowDivergenceDiagnostic, type AdminWorkflowRun, type AdminWorkflowRunDetails, type AdminWorkflowRunState, type AdminWorkflowRunsFilter, type AdminWorkflowStep, type AdminWorkflowStepAttempt, type AdminWorkflowSyncResult, type AdminWorkflowTrigger, type AdminWorkflowUpgradeResult, type AdminWorkflowVersion, EmailOutboxListOptions, EmailOutboxListResult, EmailOutboxUpdateOptions, HexclaveAdminApp, HexclaveAdminAppConstructor, HexclaveAdminAppConstructorOptions, type ListSessionReplayChunksOptions, type ListSessionReplayChunksResult, type ListSessionReplaysOptions, type ListSessionReplaysResult, ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, type SessionReplayAllEventsResult, StackAdminApp, StackAdminAppConstructor, StackAdminAppConstructorOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp } from "../../../../client-app-
|
|
1
|
+
import { a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp } from "../../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { HexclaveClientApp, HexclaveClientAppConstructor, HexclaveClientAppConstructorOptions, HexclaveClientAppJson, StackClientApp, StackClientAppConstructor, StackClientAppConstructorOptions, StackClientAppJson };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app.js","names":["_HexclaveClientAppImpl"],"sources":["../../../../../src/lib/hexclave-app/apps/interfaces/client-app.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 { KnownErrors } from \"@hexclave/shared\";\nimport { CurrentUserCrud } from \"@hexclave/shared/dist/interface/crud/current-user\";\nimport { Result } from \"@hexclave/shared/dist/utils/results\";\nimport { AsyncStoreProperty, AuthLike, GetCurrentPartialUserOptions, GetCurrentUserOptions, HandlerUrlOptions, HandlerUrls, OAuthScopesOnSignIn, RedirectMethod, RedirectToOptions, ResolvedHandlerUrls, hexclaveAppInternalsSymbol, TokenStoreInit } from \"../../common\";\nimport type { RequestListener } from \"@hexclave/shared/dist/interface/client-interface\";\nimport { CustomerInvoicesList, CustomerInvoicesRequestOptions, CustomerProductsList, CustomerProductsRequestOptions, Item } from \"../../customers\";\nimport { Project } from \"../../projects\";\nimport { ProjectCurrentUser, SyncedPartialUser, TokenPartialUser } from \"../../users\";\nimport { _HexclaveClientAppImpl } from \"../implementations\";\nimport { AnalyticsOptions } from \"../implementations/session-replay\";\n\n/** @deprecated Use `HexclaveClientAppConstructorOptions` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = {\n baseUrl?: string | { browser: string, server: string },\n extraRequestHeaders?: Record<string, string>,\n projectId?: ProjectId,\n publishableClientKey?: string,\n urls?: HandlerUrlOptions,\n oauthScopesOnSignIn?: Partial<OAuthScopesOnSignIn>,\n tokenStore?: TokenStoreInit<HasTokenStore>,\n redirectMethod?: RedirectMethod,\n inheritsFrom?: StackClientApp<any, any>,\n\n /**\n * Whether to show the Hexclave dev tool indicator in browser-like environments.\n *\n * - `true`: always show\n * - `false`: never show\n * - `\"auto\"` (default): show based on NODE_ENV or origin heuristics\n */\n devTool?: boolean | \"auto\",\n\n /**\n * By default, the Stack app will automatically prefetch some data from Stack's server when this app is first\n * constructed. This improves the performance of your app, but will create network requests that are unnecessary if\n * the app is never used or disposed of immediately. To disable this behavior, set this option to true.\n */\n noAutomaticPrefetch?: boolean,\n\n /**\n * Options for analytics and session recording. Replays are enabled by default;\n * set `{ replays: { enabled: false } }` to opt out.\n */\n analytics?: AnalyticsOptions,\n} & (\n { tokenStore: TokenStoreInit<HasTokenStore> } | { tokenStore?: undefined, inheritsFrom: StackClientApp<HasTokenStore, any> }\n) & (\n string extends ProjectId ? unknown : ({ projectId: ProjectId } | { inheritsFrom: StackClientApp<any, ProjectId> })\n);\n\n\n/** @deprecated Use `HexclaveClientAppJson` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined } & {\n uniqueIdentifier: string,\n // note: if you add more fields here, make sure to ensure the checkString in the constructor has/doesn't have them\n};\n\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & {\n readonly projectId: ProjectId,\n\n /**\n * The version of the Hexclave SDK.\n */\n readonly version: string,\n\n /**\n * @deprecated Do not use `app.urls` for navigation. It is static and does not include runtime redirect-back,\n * cross-domain auth, or sign-out state. Use the matching `redirectToXyz()` method instead, for example\n * `redirectToSignIn()`, `redirectToSignUp()`, `redirectToSignOut()`, or `redirectToAccountSettings()`.\n */\n readonly urls: Readonly<ResolvedHandlerUrls>,\n\n signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise<void>,\n signInWithCredential(options: { email: string, password: string, noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"EmailPasswordMismatch\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signUpWithCredential(options: {\n email: string,\n password: string,\n noRedirect?: boolean,\n } & ({ noVerificationCallback: true } | { noVerificationCallback?: false, verificationCallbackUrl?: string })): Promise<Result<undefined, KnownErrors[\"UserWithEmailAlreadyExists\"] | KnownErrors[\"ContactChannelAlreadyUsedForAuthBySomeoneElse\"] | KnownErrors[\"PasswordRequirementsNotMet\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n signInWithPasskey(): Promise<Result<undefined, KnownErrors[\"PasskeyAuthenticationFailed\"] | KnownErrors[\"InvalidTotpCode\"] | KnownErrors[\"PasskeyWebAuthnError\"]>>,\n callOAuthCallback(): Promise<boolean>,\n promptCliLogin(options: { appUrl: string, expiresInMillis?: number, anonRefreshToken?: string, promptLink?: (url: string, loginCode: string) => void }): Promise<Result<string, KnownErrors[\"CliAuthError\"] | KnownErrors[\"CliAuthExpiredError\"] | KnownErrors[\"CliAuthUsedError\"]>>,\n sendForgotPasswordEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<undefined, KnownErrors[\"UserNotFound\"]>>,\n sendMagicLinkEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<{ nonce: string }, KnownErrors[\"RedirectUrlNotWhitelisted\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n resetPassword(options: { code: string, password: string }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyPasswordResetCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyTeamInvitationCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n acceptTeamInvitation(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n getTeamInvitationDetails(code: string): Promise<Result<{ teamDisplayName: string }, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n verifyEmail(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n signInWithMagicLink(code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signInWithMfa(otp: string, code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n\n redirectToOAuthCallback(): Promise<void>,\n\n getConvexClientAuth(options: HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }): (args: { forceRefreshToken: boolean }) => Promise<string | null>,\n getConvexHttpClientAuth(options: { tokenStore: TokenStoreInit }): Promise<string>,\n\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): ProjectCurrentUser<ProjectId>,\n useUser(options?: GetCurrentUserOptions<HasTokenStore>): ProjectCurrentUser<ProjectId> | null,\n\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options?: GetCurrentUserOptions<HasTokenStore>): Promise<ProjectCurrentUser<ProjectId> | null>,\n\n cancelSubscription(options: { productId: string, subscriptionId?: string } | { productId: string, subscriptionId?: string, teamId: string }): Promise<void>,\n\n // note: we don't special-case 'anonymous' here to return non-null, see GetPartialUserOptions for more details\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): Promise<SyncedPartialUser | TokenPartialUser | null>,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): SyncedPartialUser | TokenPartialUser | null,\n useNavigate(): (to: string) => void, // THIS_LINE_PLATFORM react-like\n\n [hexclaveAppInternalsSymbol]: {\n toClientJson(): StackClientAppJson<HasTokenStore, ProjectId>,\n setCurrentUser(userJsonPromise: Promise<CurrentUserCrud['Client']['Read'] | null>): void,\n getConstructorOptions(): StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined },\n sendSessionReplayBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n sendAnalyticsEventBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n addRequestListener(listener: RequestListener): () => void,\n sendRequest(path: string, requestOptions: RequestInit, requestType?: \"client\" | \"server\" | \"admin\"): Promise<Response>,\n getUrls(): Readonly<ResolvedHandlerUrls>,\n getRedirectMethod(): RedirectMethod,\n redirectToUrl(url: string | URL, options?: { replace?: boolean }): Promise<void>,\n getRedirectToHandlerUrl(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<string>,\n redirectToHandler(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<void>,\n signInWithTokens(tokens: { accessToken: string, refreshToken: string }): Promise<void>,\n awaitPendingAuthResolutions(): Promise<void>,\n isTrustedRedirectUrl(url: string): Promise<boolean>,\n },\n }\n & AsyncStoreProperty<\"project\", [], Project, false>\n & AsyncStoreProperty<\n \"item\",\n [{ itemId: string, userId: string } | { itemId: string, teamId: string } | { itemId: string, customCustomerId: string }],\n Item,\n false\n >\n & AsyncStoreProperty<\n \"products\",\n [options: CustomerProductsRequestOptions],\n CustomerProductsList,\n true\n >\n & AsyncStoreProperty<\n \"invoices\",\n [options: CustomerInvoicesRequestOptions],\n CustomerInvoicesList,\n true\n >\n & { [K in `redirectTo${Capitalize<keyof Omit<HandlerUrls, 'handler' | 'oauthCallback'>>}`]: (options?: RedirectToOptions) => Promise<void> }\n & AuthLike<HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }>\n);\n/** @deprecated Use `HexclaveClientAppConstructor` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructor = {\n new <\n TokenStoreType extends string,\n HasTokenStore extends (TokenStoreType extends {} ? true : boolean),\n ProjectId extends string\n >(options: StackClientAppConstructorOptions<HasTokenStore, ProjectId>): StackClientApp<HasTokenStore, ProjectId>,\n new(options: StackClientAppConstructorOptions<boolean, string>): StackClientApp<boolean, string>,\n\n [hexclaveAppInternalsSymbol]: {\n fromClientJson<HasTokenStore extends boolean, ProjectId extends string>(\n json: StackClientAppJson<HasTokenStore, ProjectId>\n ): StackClientApp<HasTokenStore, ProjectId>,\n },\n};\nexport type HexclaveClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppJson<HasTokenStore, ProjectId>;\nexport type HexclaveClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = StackClientApp<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppConstructor = StackClientAppConstructor;\nexport const HexclaveClientApp: HexclaveClientAppConstructor = _HexclaveClientAppImpl;\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport const StackClientApp: StackClientAppConstructor = HexclaveClientApp;\n"],"mappings":";;AAwLA,MAAa,yDAAkDA,CAAAA,CAAAA;;AAE/D,MAAa,iBAA4C"}
|
|
1
|
+
{"version":3,"file":"client-app.js","names":["_HexclaveClientAppImpl"],"sources":["../../../../../src/lib/hexclave-app/apps/interfaces/client-app.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 { KnownErrors } from \"@hexclave/shared\";\nimport type { RequestListener } from \"@hexclave/shared/dist/interface/client-interface\";\nimport { CurrentUserCrud } from \"@hexclave/shared/dist/interface/crud/current-user\";\nimport { Result } from \"@hexclave/shared/dist/utils/results\";\nimport { AsyncStoreProperty, AuthLike, GetCurrentPartialUserOptions, GetCurrentUserOptions, HandlerUrlOptions, HandlerUrls, hexclaveAppInternalsSymbol, OAuthScopesOnSignIn, RedirectMethod, RedirectToOptions, ResolvedHandlerUrls, TokenStoreInit } from \"../../common\";\nimport { CustomerInvoicesList, CustomerInvoicesRequestOptions, CustomerProductsList, CustomerProductsRequestOptions, Item } from \"../../customers\";\nimport { Project } from \"../../projects\";\nimport { ProjectCurrentUser, SyncedPartialUser, TokenPartialUser } from \"../../users\";\nimport { _HexclaveClientAppImpl } from \"../implementations\";\nimport { AnalyticsOptions } from \"../implementations/session-replay\";\n\n/** @deprecated Use `HexclaveClientAppConstructorOptions` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = {\n baseUrl?: string | { browser: string, server: string },\n extraRequestHeaders?: Record<string, string>,\n projectId?: ProjectId,\n publishableClientKey?: string,\n urls?: HandlerUrlOptions,\n oauthScopesOnSignIn?: Partial<OAuthScopesOnSignIn>,\n tokenStore?: TokenStoreInit<HasTokenStore>,\n redirectMethod?: RedirectMethod,\n inheritsFrom?: StackClientApp<any, any>,\n\n /**\n * Whether to show the Hexclave dev tool indicator in browser-like environments.\n *\n * - `true`: always show\n * - `false`: never show\n * - `\"auto\"` (default): show based on NODE_ENV or origin heuristics\n */\n devTool?: boolean | \"auto\",\n\n /**\n * By default, the Stack app will automatically prefetch some data from Stack's server when this app is first\n * constructed. This improves the performance of your app, but will create network requests that are unnecessary if\n * the app is never used or disposed of immediately. To disable this behavior, set this option to true.\n */\n noAutomaticPrefetch?: boolean,\n\n /**\n * Whether the constructor starts browser integrations and other automatic side effects. Defaults to `true`.\n *\n * Set this to `false` when the app is instantiated inside a custom dashboard. Explicit method calls remain\n * available and can still perform their documented side effects.\n */\n automaticSideEffects?: boolean,\n\n /**\n * Options for analytics and session recording. Replays are enabled by default;\n * set `{ replays: { enabled: false } }` to opt out.\n */\n analytics?: AnalyticsOptions,\n} & (\n { tokenStore: TokenStoreInit<HasTokenStore> } | { tokenStore?: undefined, inheritsFrom: StackClientApp<HasTokenStore, any> }\n) & (\n string extends ProjectId ? unknown : ({ projectId: ProjectId } | { inheritsFrom: StackClientApp<any, ProjectId> })\n);\n\n\n/** @deprecated Use `HexclaveClientAppJson` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined } & {\n uniqueIdentifier: string,\n // note: if you add more fields here, make sure to ensure the checkString in the constructor has/doesn't have them\n};\n\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & {\n readonly projectId: ProjectId,\n\n /**\n * The version of the Hexclave SDK.\n */\n readonly version: string,\n\n /**\n * @deprecated Do not use `app.urls` for navigation. It is static and does not include runtime redirect-back,\n * cross-domain auth, or sign-out state. Use the matching `redirectToXyz()` method instead, for example\n * `redirectToSignIn()`, `redirectToSignUp()`, `redirectToSignOut()`, or `redirectToAccountSettings()`.\n */\n readonly urls: Readonly<ResolvedHandlerUrls>,\n\n signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise<void>,\n signInWithCredential(options: { email: string, password: string, noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"EmailPasswordMismatch\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signUpWithCredential(options: {\n email: string,\n password: string,\n noRedirect?: boolean,\n } & ({ noVerificationCallback: true } | { noVerificationCallback?: false, verificationCallbackUrl?: string })): Promise<Result<undefined, KnownErrors[\"UserWithEmailAlreadyExists\"] | KnownErrors[\"ContactChannelAlreadyUsedForAuthBySomeoneElse\"] | KnownErrors[\"PasswordRequirementsNotMet\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n signInWithPasskey(): Promise<Result<undefined, KnownErrors[\"PasskeyAuthenticationFailed\"] | KnownErrors[\"InvalidTotpCode\"] | KnownErrors[\"PasskeyWebAuthnError\"]>>,\n callOAuthCallback(): Promise<boolean>,\n promptCliLogin(options: { appUrl: string, expiresInMillis?: number, anonRefreshToken?: string, promptLink?: (url: string, loginCode: string) => void }): Promise<Result<string, KnownErrors[\"CliAuthError\"] | KnownErrors[\"CliAuthExpiredError\"] | KnownErrors[\"CliAuthUsedError\"]>>,\n sendForgotPasswordEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<undefined, KnownErrors[\"UserNotFound\"]>>,\n sendMagicLinkEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<{ nonce: string }, KnownErrors[\"RedirectUrlNotWhitelisted\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n resetPassword(options: { code: string, password: string }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyPasswordResetCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyTeamInvitationCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n acceptTeamInvitation(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n getTeamInvitationDetails(code: string): Promise<Result<{ teamDisplayName: string }, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n verifyEmail(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n signInWithMagicLink(code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signInWithMfa(otp: string, code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n\n redirectToOAuthCallback(): Promise<void>,\n\n getConvexClientAuth(options: HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }): (args: { forceRefreshToken: boolean }) => Promise<string | null>,\n getConvexHttpClientAuth(options: { tokenStore: TokenStoreInit }): Promise<string>,\n\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): ProjectCurrentUser<ProjectId>,\n useUser(options?: GetCurrentUserOptions<HasTokenStore>): ProjectCurrentUser<ProjectId> | null,\n\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options?: GetCurrentUserOptions<HasTokenStore>): Promise<ProjectCurrentUser<ProjectId> | null>,\n\n cancelSubscription(options: { productId: string, subscriptionId?: string } | { productId: string, subscriptionId?: string, teamId: string }): Promise<void>,\n\n // note: we don't special-case 'anonymous' here to return non-null, see GetPartialUserOptions for more details\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): Promise<SyncedPartialUser | TokenPartialUser | null>,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): SyncedPartialUser | TokenPartialUser | null,\n useNavigate(): (to: string) => void, // THIS_LINE_PLATFORM react-like\n\n [hexclaveAppInternalsSymbol]: {\n toClientJson(): StackClientAppJson<HasTokenStore, ProjectId>,\n setCurrentUser(userJsonPromise: Promise<CurrentUserCrud['Client']['Read'] | null>): void,\n getConstructorOptions(): StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined },\n sendSessionReplayBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n sendAnalyticsEventBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n addRequestListener(listener: RequestListener): () => void,\n sendRequest(path: string, requestOptions: RequestInit, requestType?: \"client\" | \"server\" | \"admin\"): Promise<Response>,\n getUrls(): Readonly<ResolvedHandlerUrls>,\n getRedirectMethod(): RedirectMethod,\n redirectToUrl(url: string | URL, options?: { replace?: boolean }): Promise<void>,\n getRedirectToHandlerUrl(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<string>,\n redirectToHandler(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<void>,\n /** Raw flow metadata only. Never navigate to this value without normal redirect validation. */\n getRawAfterAuthReturnTo(): string | null,\n signInWithTokens(tokens: { accessToken: string, refreshToken: string }): Promise<void>,\n awaitPendingAuthResolutions(): Promise<void>,\n isTrustedRedirectUrl(url: string): Promise<boolean>,\n },\n }\n & AsyncStoreProperty<\"project\", [], Project, false>\n & AsyncStoreProperty<\n \"item\",\n [{ itemId: string, userId: string } | { itemId: string, teamId: string } | { itemId: string, customCustomerId: string }],\n Item,\n false\n >\n & AsyncStoreProperty<\n \"products\",\n [options: CustomerProductsRequestOptions],\n CustomerProductsList,\n true\n >\n & AsyncStoreProperty<\n \"invoices\",\n [options: CustomerInvoicesRequestOptions],\n CustomerInvoicesList,\n true\n >\n & { [K in `redirectTo${Capitalize<keyof Omit<HandlerUrls, 'handler' | 'oauthCallback'>>}`]: (options?: RedirectToOptions) => Promise<void> }\n & AuthLike<HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }>\n);\n/** @deprecated Use `HexclaveClientAppConstructor` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructor = {\n new <\n TokenStoreType extends string,\n HasTokenStore extends (TokenStoreType extends {} ? true : boolean),\n ProjectId extends string\n >(options: StackClientAppConstructorOptions<HasTokenStore, ProjectId>): StackClientApp<HasTokenStore, ProjectId>,\n new(options: StackClientAppConstructorOptions<boolean, string>): StackClientApp<boolean, string>,\n\n [hexclaveAppInternalsSymbol]: {\n fromClientJson<HasTokenStore extends boolean, ProjectId extends string>(\n json: StackClientAppJson<HasTokenStore, ProjectId>\n ): StackClientApp<HasTokenStore, ProjectId>,\n },\n};\nexport type HexclaveClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppJson<HasTokenStore, ProjectId>;\nexport type HexclaveClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = StackClientApp<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppConstructor = StackClientAppConstructor;\nexport const HexclaveClientApp: HexclaveClientAppConstructor = _HexclaveClientAppImpl;\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport const StackClientApp: StackClientAppConstructor = HexclaveClientApp;\n"],"mappings":";;AAkMA,MAAa,yDAAkDA,CAAAA,CAAAA;;AAE/D,MAAa,iBAA4C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as StackServerAppConstructor, I as HexclaveServerApp, L as HexclaveServerAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, z as StackServerApp } from "../../../../client-app-
|
|
1
|
+
import { B as StackServerAppConstructor, I as HexclaveServerApp, L as HexclaveServerAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, z as StackServerApp } from "../../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { HexclaveServerApp, HexclaveServerAppConstructor, HexclaveServerAppConstructorOptions, StackServerApp, StackServerAppConstructor, StackServerAppConstructorOptions };
|
|
@@ -6,7 +6,7 @@ import { a as PlanUsageRow, i as PlanUsagePlanId, n as PlanUsageKind, r as PlanU
|
|
|
6
6
|
import { a as AdminWorkflowRunState, c as AdminWorkflowStepAttempt, d as AdminWorkflowUpgradeResult, f as AdminWorkflowVersion, i as AdminWorkflowRunDetails, l as AdminWorkflowSyncResult, n as AdminWorkflowDivergenceDiagnostic, o as AdminWorkflowRunsFilter, r as AdminWorkflowRun, s as AdminWorkflowStep, t as AdminWorkflow, u as AdminWorkflowTrigger } from "../../workflows-DEb7pIuQ.js";
|
|
7
7
|
import { r as OAuthConnection, t as Connection } from "../../index-C_kxyHao.js";
|
|
8
8
|
import { i as ServerContactChannel, t as ContactChannel } from "../../index-DN04TjLM.js";
|
|
9
|
-
import { $ as TeamCreateOptions, B as StackServerAppConstructor, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, H as EditableTeamMemberProfile, I as HexclaveServerApp, J as ServerTeamCreateOptions, K as ServerListUsersOptions, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, Ot as User, P as StackAdminAppConstructor, Q as Team, R as HexclaveServerAppConstructorOptions, St as ServerUser, T as EmailOutboxListResult, U as ReceivedTeamInvitation, V as StackServerAppConstructorOptions, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, _ as AdminProjectCreateOptions, _t as OAuthProvider, a as StackClientApp, c as StackClientAppJson, d as AdminDeploymentEnvVarOptions, et as TeamInvitation, f as AdminDeploymentRunJson, ft as CurrentInternalServerUser, g as AdminProject, h as AdminOwnedProject, ht as CurrentUser, i as HexclaveClientAppJson, it as TeamUser, k as HexclaveAdminAppConstructorOptions, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, mt as CurrentServerUser, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, p as AdminDeploymentServiceBuildOptions, pt as CurrentInternalUser, q as ServerTeam, r as HexclaveClientAppConstructorOptions, rt as TeamUpdateOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, tt as TeamMemberProfile, u as AdminDeploymentEnvVarJson, ut as Auth, v as AdminProjectUpdateOptions, w as EmailOutboxListOptions, x as PushedConfigSource, xt as ServerOAuthProvider, y as Project, z as StackServerApp } from "../../client-app-
|
|
9
|
+
import { $ as TeamCreateOptions, B as StackServerAppConstructor, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, H as EditableTeamMemberProfile, I as HexclaveServerApp, J as ServerTeamCreateOptions, K as ServerListUsersOptions, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, Ot as User, P as StackAdminAppConstructor, Q as Team, R as HexclaveServerAppConstructorOptions, St as ServerUser, T as EmailOutboxListResult, U as ReceivedTeamInvitation, V as StackServerAppConstructorOptions, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, _ as AdminProjectCreateOptions, _t as OAuthProvider, a as StackClientApp, c as StackClientAppJson, d as AdminDeploymentEnvVarOptions, et as TeamInvitation, f as AdminDeploymentRunJson, ft as CurrentInternalServerUser, g as AdminProject, h as AdminOwnedProject, ht as CurrentUser, i as HexclaveClientAppJson, it as TeamUser, k as HexclaveAdminAppConstructorOptions, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, mt as CurrentServerUser, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, p as AdminDeploymentServiceBuildOptions, pt as CurrentInternalUser, q as ServerTeam, r as HexclaveClientAppConstructorOptions, rt as TeamUpdateOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, tt as TeamMemberProfile, u as AdminDeploymentEnvVarJson, ut as Auth, v as AdminProjectUpdateOptions, w as EmailOutboxListOptions, x as PushedConfigSource, xt as ServerOAuthProvider, y as Project, z as StackServerApp } from "../../client-app-BCT5p_70.js";
|
|
10
10
|
import { a as AdminProjectConfigUpdateOptions, i as AdminProjectConfig, n as AdminEmailConfig, o as OAuthProviderConfig, r as AdminOAuthProviderConfig, s as ProjectConfig, t as AdminDomainConfig } from "../../index-B-MazpM_.js";
|
|
11
11
|
import { r as getPagePrompt } from "../../url-targets-CWO0mjTr.js";
|
|
12
12
|
export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentEnvVarOptions, type AdminDeploymentRunJson, type AdminDeploymentServiceBuildOptions, type AdminDeploymentServiceJson, type AdminDomainConfig, type AdminEmailConfig, type AdminEmailOutbox, type AdminEmailOutboxRecipient, type AdminEmailOutboxSimpleStatus, type AdminEmailOutboxStatus, type AdminOAuthProviderConfig, type AdminOwnedProject, type AdminProject, type AdminProjectConfig, type AdminProjectConfigUpdateOptions, type AdminProjectCreateOptions, type AdminProjectPermission, type AdminProjectPermissionDefinition, type AdminProjectPermissionDefinitionCreateOptions, type AdminProjectPermissionDefinitionUpdateOptions, type AdminProjectUpdateOptions, type AdminSendAttemptError, type AdminSentEmail, type AdminTeamPermission, type AdminTeamPermissionDefinition, type AdminTeamPermissionDefinitionCreateOptions, type AdminTeamPermissionDefinitionUpdateOptions, type AdminWorkflow, type AdminWorkflowDivergenceDiagnostic, type AdminWorkflowRun, type AdminWorkflowRunDetails, type AdminWorkflowRunState, type AdminWorkflowRunsFilter, type AdminWorkflowStep, type AdminWorkflowStepAttempt, type AdminWorkflowSyncResult, type AdminWorkflowTrigger, type AdminWorkflowUpgradeResult, type AdminWorkflowVersion, type Auth, type Connection, type ContactChannel, type CurrentInternalServerUser, type CurrentInternalUser, type CurrentServerUser, type CurrentUser, type EditableTeamMemberProfile, type EmailOutboxListOptions, type EmailOutboxListResult, type EmailOutboxUpdateOptions, type GetCurrentUserOptions, type GetCurrentUserOptions as GetUserOptions, type HandlerUrlOptions, type HandlerUrls, HexclaveAdminApp, type HexclaveAdminAppConstructor, type HexclaveAdminAppConstructorOptions, HexclaveClientApp, type HexclaveClientAppConstructor, type HexclaveClientAppConstructorOptions, type HexclaveClientAppJson, HexclaveServerApp, type HexclaveServerAppConstructor, type HexclaveServerAppConstructorOptions, type InternalApiKey, type InternalApiKeyBase, type InternalApiKeyBaseCrudRead, type InternalApiKeyCreateOptions, type InternalApiKeyFirstView, type OAuthConnection, type OAuthProvider, type OAuthProviderConfig, type OAuthScopesOnSignIn, type PlanUsage, type PlanUsageKind, type PlanUsageNextPlanId, type PlanUsagePlanId, type PlanUsageRow, type Project, type ProjectConfig, type PushedConfigSource, type ReceivedTeamInvitation, type ResolvedHandlerUrls, type SentTeamInvitation, type ServerContactChannel, type ServerListUsersOptions, type ServerOAuthProvider, type ServerTeam, type ServerTeamCreateOptions, type ServerTeamMemberProfile, type ServerTeamUpdateOptions, type ServerTeamUser, type ServerUser, StackAdminApp, type StackAdminAppConstructor, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructor, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructor, type StackServerAppConstructorOptions, type Team, type TeamCreateOptions, type TeamInvitation, type TeamMemberProfile, type TeamUpdateOptions, type TeamUser, type User, getPagePrompt, hexclaveAppInternalsSymbol };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as adminProjectUpdateOptionsToCrud, S as adminProjectCreateOptionsToCrud, _ as AdminProjectCreateOptions, b as PushConfigOptions, d as AdminDeploymentEnvVarOptions, f as AdminDeploymentRunJson, g as AdminProject, h as AdminOwnedProject, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, p as AdminDeploymentServiceBuildOptions, u as AdminDeploymentEnvVarJson, v as AdminProjectUpdateOptions, x as PushedConfigSource, y as Project } from "../../../client-app-
|
|
1
|
+
import { C as adminProjectUpdateOptionsToCrud, S as adminProjectCreateOptionsToCrud, _ as AdminProjectCreateOptions, b as PushConfigOptions, d as AdminDeploymentEnvVarOptions, f as AdminDeploymentRunJson, g as AdminProject, h as AdminOwnedProject, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, p as AdminDeploymentServiceBuildOptions, u as AdminDeploymentEnvVarJson, v as AdminProjectUpdateOptions, x as PushedConfigSource, y as Project } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentEnvVarOptions, type AdminDeploymentRunJson, type AdminDeploymentServiceBuildOptions, type AdminDeploymentServiceJson, AdminOwnedProject, AdminProject, AdminProjectCreateOptions, AdminProjectUpdateOptions, Project, PushConfigOptions, PushedConfigSource, adminProjectCreateOptionsToCrud, adminProjectUpdateOptionsToCrud };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as TeamCreateOptions, G as ServerListTeamsOptions, H as EditableTeamMemberProfile, J as ServerTeamCreateOptions, K as ServerListUsersOptions, Q as Team, U as ReceivedTeamInvitation, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, at as serverTeamCreateOptionsToCrud, ct as teamUpdateOptionsToCrud, et as TeamInvitation, it as TeamUser, nt as TeamMemberProfileUpdateOptions, ot as serverTeamUpdateOptionsToCrud, q as ServerTeam, rt as TeamUpdateOptions, st as teamCreateOptionsToCrud, tt as TeamMemberProfile } from "../../../client-app-
|
|
1
|
+
import { $ as TeamCreateOptions, G as ServerListTeamsOptions, H as EditableTeamMemberProfile, J as ServerTeamCreateOptions, K as ServerListUsersOptions, Q as Team, U as ReceivedTeamInvitation, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, at as serverTeamCreateOptionsToCrud, ct as teamUpdateOptionsToCrud, et as TeamInvitation, it as TeamUser, nt as TeamMemberProfileUpdateOptions, ot as serverTeamUpdateOptionsToCrud, q as ServerTeam, rt as TeamUpdateOptions, st as teamCreateOptionsToCrud, tt as TeamMemberProfile } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { EditableTeamMemberProfile, ReceivedTeamInvitation, SentTeamInvitation, ServerListTeamsOptions, ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions, ServerTeamMemberProfile, ServerTeamUpdateOptions, ServerTeamUser, Team, TeamCreateOptions, TeamInvitation, TeamMemberProfile, TeamMemberProfileUpdateOptions, TeamUpdateOptions, TeamUser, serverTeamCreateOptionsToCrud, serverTeamUpdateOptionsToCrud, teamCreateOptionsToCrud, teamUpdateOptionsToCrud };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as UserUpdateOptions, Ct as ServerUserCreateOptions, Dt as TokenPartialUser, Et as SyncedPartialUser, Mt as serverUserUpdateOptionsToCrud, Nt as userUpdateOptionsToCrud, Ot as User, Pt as withUserDestructureGuard, St as ServerUser, Tt as SyncedPartialServerUser, _t as OAuthProvider, bt as ServerBaseUser, dt as BaseUser, ft as CurrentInternalServerUser, gt as InternalUserExtra, ht as CurrentUser, jt as serverUserCreateOptionsToCrud, kt as UserExtra, lt as ActiveSession, mt as CurrentServerUser, pt as CurrentInternalUser, ut as Auth, vt as ProjectCurrentServerUser, wt as ServerUserUpdateOptions, xt as ServerOAuthProvider, yt as ProjectCurrentUser } from "../../../client-app-
|
|
1
|
+
import { At as UserUpdateOptions, Ct as ServerUserCreateOptions, Dt as TokenPartialUser, Et as SyncedPartialUser, Mt as serverUserUpdateOptionsToCrud, Nt as userUpdateOptionsToCrud, Ot as User, Pt as withUserDestructureGuard, St as ServerUser, Tt as SyncedPartialServerUser, _t as OAuthProvider, bt as ServerBaseUser, dt as BaseUser, ft as CurrentInternalServerUser, gt as InternalUserExtra, ht as CurrentUser, jt as serverUserCreateOptionsToCrud, kt as UserExtra, lt as ActiveSession, mt as CurrentServerUser, pt as CurrentInternalUser, ut as Auth, vt as ProjectCurrentServerUser, wt as ServerUserUpdateOptions, xt as ServerOAuthProvider, yt as ProjectCurrentUser } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { ActiveSession, Auth, BaseUser, CurrentInternalServerUser, CurrentInternalUser, CurrentServerUser, CurrentUser, InternalUserExtra, OAuthProvider, ProjectCurrentServerUser, ProjectCurrentUser, ServerBaseUser, ServerOAuthProvider, ServerUser, ServerUserCreateOptions, ServerUserUpdateOptions, SyncedPartialServerUser, SyncedPartialUser, TokenPartialUser, User, UserExtra, UserUpdateOptions, serverUserCreateOptionsToCrud, serverUserUpdateOptionsToCrud, userUpdateOptionsToCrud, withUserDestructureGuard };
|
package/dist/lib/hooks.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useStackApp, r as useUser, t as useHexclaveApp } from "../hooks-
|
|
1
|
+
import { n as useStackApp, r as useUser, t as useHexclaveApp } from "../hooks-CUe5bc3s.js";
|
|
2
2
|
export { useHexclaveApp, useStackApp, useUser };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-callback-tCVTRbF2.d.ts","names":[],"sources":["../src/components-page/oauth-callback.tsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"oauth-callback-tCVTRbF2.d.ts","names":[],"sources":["../src/components-page/oauth-callback.tsx"],"mappings":";iBAiBgB,aAAA;EAAgB;AAAA;EAAc,QAAA;AAAA,gCAAoB,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StackClientApp, c as StackClientAppJson } from "../client-app-
|
|
1
|
+
import { a as StackClientApp, c as StackClientAppJson } from "../client-app-BCT5p_70.js";
|
|
2
2
|
import { CurrentUserCrud } from "@hexclave/shared/dist/interface/crud/current-user";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as HexclaveProvider, r as StackProvider, t as ActiveProvider } from "../hexclave-provider-
|
|
1
|
+
import { n as HexclaveProvider, r as StackProvider, t as ActiveProvider } from "../hexclave-provider-BKxi3Vy-.js";
|
|
2
2
|
export { HexclaveProvider, StackProvider, ActiveProvider as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StackClientApp } from "../client-app-
|
|
1
|
+
import { a as StackClientApp } from "../client-app-BCT5p_70.js";
|
|
2
2
|
//#region src/pushed-config-error-overlay/index.d.ts
|
|
3
3
|
declare function mountPushedConfigErrorOverlay(app: StackClientApp<true>): () => void;
|
|
4
4
|
//#endregion
|
|
@@ -28,8 +28,9 @@ declare function planRedirectToHandler(options: {
|
|
|
28
28
|
noRedirectBack: boolean;
|
|
29
29
|
currentUrl: URL | null;
|
|
30
30
|
localOAuthCallbackUrl: string;
|
|
31
|
+
rawHomeUrl: string;
|
|
31
32
|
getCrossDomainHandoffParams: (currentUrl: URL) => Promise<CrossDomainHandoffParams>;
|
|
32
33
|
}): Promise<RedirectToHandlerPlan>;
|
|
33
34
|
//#endregion
|
|
34
35
|
export { planRedirectToHandler as i, crossDomainAuthQueryParams as n, getCrossDomainHandoffParamsFromCurrentUrl as r, CrossDomainHandoffParams as t };
|
|
35
|
-
//# sourceMappingURL=redirect-page-urls-
|
|
36
|
+
//# sourceMappingURL=redirect-page-urls-BEWG0AtP.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redirect-page-urls-BEWG0AtP.d.ts","names":[],"sources":["../src/lib/hexclave-app/apps/implementations/redirect-page-urls.ts"],"mappings":";;;cAQa,0BAAA;EAAA;;;;;KAqBD,wBAAA;EACV,KAAA;EACA,aAAa;AAAA;AAAA,iBAGC,yCAAA,CAA0C,UAAA,EAAY,GAAA,GAAM,wBAAwB;AAAA,KA0K/F,qBAAA;EACC,IAAA;EAAkB,GAAA;AAAA;EAEpB,IAAA;EACA,WAAA;EACA,KAAA;EACA,aAAA;EACA,wBAAA;AAAA;AAAA,iBA4CkB,qBAAA,CAAsB,OAAA;EAC1C,WAAA,QAAmB,WAAA;EACnB,aAAA;EACA,cAAA;EACA,UAAA,EAAY,GAAA;EACZ,qBAAA;EACA,UAAA;EACA,2BAAA,GAA8B,UAAA,EAAY,GAAA,KAAQ,OAAA,CAAQ,wBAAA;AAAA,IACxD,OAAA,CAAQ,qBAAA"}
|
package/dist/utils/url.js
CHANGED
|
@@ -3,10 +3,18 @@ let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/er
|
|
|
3
3
|
//#region src/utils/url.ts
|
|
4
4
|
function constructRedirectUrl(redirectUrl, callbackUrlName) {
|
|
5
5
|
if (typeof window === "undefined" || !window.location) throw new _hexclave_shared_dist_utils_errors.HexclaveAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });
|
|
6
|
-
const retainedQueryParams = [
|
|
6
|
+
const retainedQueryParams = [
|
|
7
|
+
"after_auth_return_to",
|
|
8
|
+
"hexclave_cross_domain_state",
|
|
9
|
+
"hexclave_cross_domain_code_challenge",
|
|
10
|
+
"hexclave_cross_domain_after_callback_redirect_url"
|
|
11
|
+
];
|
|
7
12
|
const currentUrl = new URL(window.location.href);
|
|
8
13
|
const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);
|
|
9
|
-
for (const param of retainedQueryParams)
|
|
14
|
+
for (const param of retainedQueryParams) {
|
|
15
|
+
const value = currentUrl.searchParams.get(param);
|
|
16
|
+
if (value != null) url.searchParams.set(param, value);
|
|
17
|
+
}
|
|
10
18
|
url.hash = "";
|
|
11
19
|
return url.toString();
|
|
12
20
|
}
|
package/dist/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","names":["HexclaveAssertionError"],"sources":["../../src/utils/url.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 { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\n\n\nexport function constructRedirectUrl(redirectUrl: URL | string | undefined, callbackUrlName: string) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window === 'undefined' || !window.location) {\n throw new HexclaveAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });\n }\n\n const retainedQueryParams = [\"after_auth_return_to\"];\n const currentUrl = new URL(window.location.href);\n const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);\n for (const param of retainedQueryParams) {\n
|
|
1
|
+
{"version":3,"file":"url.js","names":["HexclaveAssertionError"],"sources":["../../src/utils/url.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 { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\n\n\nexport function constructRedirectUrl(redirectUrl: URL | string | undefined, callbackUrlName: string) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window === 'undefined' || !window.location) {\n throw new HexclaveAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });\n }\n\n // These parameters form one continuation. Keeping only after_auth_return_to can return to the\n // callback URL but cannot complete its cross-domain PKCE handoff after an email opens in a new\n // tab.\n const retainedQueryParams = [\n \"after_auth_return_to\",\n \"hexclave_cross_domain_state\",\n \"hexclave_cross_domain_code_challenge\",\n \"hexclave_cross_domain_after_callback_redirect_url\",\n ];\n const currentUrl = new URL(window.location.href);\n const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);\n for (const param of retainedQueryParams) {\n const value = currentUrl.searchParams.get(param);\n if (value != null) {\n url.searchParams.set(param, value);\n }\n }\n url.hash = \"\";\n return url.toString();\n}\n"],"mappings":";;;AAOA,SAAgB,qBAAqB,aAAuC,iBAAyB;CAEnG,IAAI,OAAO,WAAW,eAAe,CAAC,OAAO,UAC3C,MAAM,IAAIA,mCAAAA,uBAAuB,GAAG,gBAAgB,oDAAoD,EAAE,YAAY,CAAC;CAMzH,MAAM,sBAAsB;EAC1B;EACA;EACA;EACA;CACF;CACA,MAAM,aAAa,IAAI,IAAI,OAAO,SAAS,IAAI;CAC/C,MAAM,MAAM,cAAc,IAAI,IAAI,aAAa,OAAO,SAAS,IAAI,IAAI,IAAI,IAAI,OAAO,SAAS,IAAI;CACnG,KAAK,MAAM,SAAS,qBAAqB;EACvC,MAAM,QAAQ,WAAW,aAAa,IAAI,KAAK;EAC/C,IAAI,SAAS,MACX,IAAI,aAAa,IAAI,OAAO,KAAK;CAErC;CACA,IAAI,OAAO;CACX,OAAO,IAAI,SAAS;AACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
let vitest = require("vitest");
|
|
2
|
+
let __url_js = require("./url.js");
|
|
3
|
+
//#region src/utils/url.test.ts
|
|
4
|
+
const previousWindow = Reflect.get(globalThis, "window");
|
|
5
|
+
const hadPreviousWindow = Reflect.has(globalThis, "window");
|
|
6
|
+
(0, vitest.afterEach)(() => {
|
|
7
|
+
if (hadPreviousWindow) Reflect.set(globalThis, "window", previousWindow);
|
|
8
|
+
else Reflect.deleteProperty(globalThis, "window");
|
|
9
|
+
});
|
|
10
|
+
(0, vitest.describe)("constructRedirectUrl", () => {
|
|
11
|
+
(0, vitest.it)("transports the complete cross-domain return state to an email callback", () => {
|
|
12
|
+
const currentUrl = new URL("https://hosted.example.test/handler/forgot-password");
|
|
13
|
+
currentUrl.searchParams.set("after_auth_return_to", "https://customer.example.test/handler/oauth-callback?hexclave_cross_domain_auth=1");
|
|
14
|
+
currentUrl.searchParams.set("hexclave_cross_domain_state", "outer-state");
|
|
15
|
+
currentUrl.searchParams.set("hexclave_cross_domain_code_challenge", "outer-challenge");
|
|
16
|
+
currentUrl.searchParams.set("hexclave_cross_domain_after_callback_redirect_url", "https://customer.example.test/dashboard");
|
|
17
|
+
Reflect.set(globalThis, "window", { location: { href: currentUrl.toString() } });
|
|
18
|
+
(0, vitest.expect)(new URL((0, __url_js.constructRedirectUrl)("/handler/password-reset#discarded", "callbackUrl")).toString()).toBe("https://hosted.example.test/handler/password-reset?after_auth_return_to=https%3A%2F%2Fcustomer.example.test%2Fhandler%2Foauth-callback%3Fhexclave_cross_domain_auth%3D1&hexclave_cross_domain_state=outer-state&hexclave_cross_domain_code_challenge=outer-challenge&hexclave_cross_domain_after_callback_redirect_url=https%3A%2F%2Fcustomer.example.test%2Fdashboard");
|
|
19
|
+
});
|
|
20
|
+
(0, vitest.it)("does not synthesize the forgot-password page as a return target", () => {
|
|
21
|
+
Reflect.set(globalThis, "window", { location: { href: "https://hosted.example.test/handler/forgot-password" } });
|
|
22
|
+
(0, vitest.expect)((0, __url_js.constructRedirectUrl)("/handler/password-reset", "callbackUrl")).toBe("https://hosted.example.test/handler/password-reset");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=url.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.test.js","names":[],"sources":["../../src/utils/url.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 { afterEach, describe, expect, it } from \"vitest\";\nimport { constructRedirectUrl } from \"./url\";\n\nconst previousWindow = Reflect.get(globalThis, \"window\");\nconst hadPreviousWindow = Reflect.has(globalThis, \"window\");\n\nafterEach(() => {\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n});\n\ndescribe(\"constructRedirectUrl\", () => {\n it(\"transports the complete cross-domain return state to an email callback\", () => {\n const currentUrl = new URL(\"https://hosted.example.test/handler/forgot-password\");\n currentUrl.searchParams.set(\"after_auth_return_to\", \"https://customer.example.test/handler/oauth-callback?hexclave_cross_domain_auth=1\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", \"outer-state\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", \"outer-challenge\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", \"https://customer.example.test/dashboard\");\n Reflect.set(globalThis, \"window\", {\n location: {\n href: currentUrl.toString(),\n },\n });\n\n const callbackUrl = new URL(constructRedirectUrl(\"/handler/password-reset#discarded\", \"callbackUrl\"));\n\n expect(callbackUrl.toString()).toBe(\n \"https://hosted.example.test/handler/password-reset\"\n + \"?after_auth_return_to=https%3A%2F%2Fcustomer.example.test%2Fhandler%2Foauth-callback%3Fhexclave_cross_domain_auth%3D1\"\n + \"&hexclave_cross_domain_state=outer-state\"\n + \"&hexclave_cross_domain_code_challenge=outer-challenge\"\n + \"&hexclave_cross_domain_after_callback_redirect_url=https%3A%2F%2Fcustomer.example.test%2Fdashboard\",\n );\n });\n\n it(\"does not synthesize the forgot-password page as a return target\", () => {\n Reflect.set(globalThis, \"window\", {\n location: {\n href: \"https://hosted.example.test/handler/forgot-password\",\n },\n });\n\n expect(constructRedirectUrl(\"/handler/password-reset\", \"callbackUrl\")).toBe(\n \"https://hosted.example.test/handler/password-reset\",\n );\n });\n});\n"],"mappings":";;;AAOA,MAAM,iBAAiB,QAAQ,IAAI,YAAY,QAAQ;AACvD,MAAM,oBAAoB,QAAQ,IAAI,YAAY,QAAQ;4BAE1C;CACd,IAAI,mBACF,QAAQ,IAAI,YAAY,UAAU,cAAc;MAEhD,QAAQ,eAAe,YAAY,QAAQ;AAE/C,CAAC;qBAEQ,8BAA8B;CACrC,CAAA,GAAA,OAAA,GAAA,CAAG,gFAAgF;EACjF,MAAM,aAAa,IAAI,IAAI,qDAAqD;EAChF,WAAW,aAAa,IAAI,wBAAwB,mFAAmF;EACvI,WAAW,aAAa,IAAI,+BAA+B,aAAa;EACxE,WAAW,aAAa,IAAI,wCAAwC,iBAAiB;EACrF,WAAW,aAAa,IAAI,qDAAqD,yCAAyC;EAC1H,QAAQ,IAAI,YAAY,UAAU,EAChC,UAAU,EACR,MAAM,WAAW,SAAS,EAC5B,EACF,CAAC;EAID,CAAA,GAAA,OAAA,OAAA,CAAO,IAFiB,KAAA,GAAA,SAAA,qBAAA,CAAyB,qCAAqC,aAAa,CAElF,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAC7B,wWAKF;CACF,CAAC;CAED,CAAA,GAAA,OAAA,GAAA,CAAG,yEAAyE;EAC1E,QAAQ,IAAI,YAAY,UAAU,EAChC,UAAU,EACR,MAAM,sDACR,EACF,CAAC;EAED,CAAA,GAAA,OAAA,OAAA,EAAA,GAAA,SAAA,qBAAA,CAA4B,2BAA2B,aAAa,CAAC,CAAC,CAAC,KACrE,oDACF;CACF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template (FOR package.json FILES, PLEASE EDIT package-template.json)",
|
|
3
3
|
"name": "@hexclave/next",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.75",
|
|
5
5
|
"repository": "https://github.com/hexclave/hexclave",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"tailwindcss-animate": "^1.0.7",
|
|
75
75
|
"rrweb": "^1.1.3",
|
|
76
76
|
"yup": "^1.7.1",
|
|
77
|
-
"@hexclave/sc": "1.0.
|
|
78
|
-
"@hexclave/
|
|
79
|
-
"@hexclave/
|
|
77
|
+
"@hexclave/sc": "1.0.75",
|
|
78
|
+
"@hexclave/ui": "1.0.75",
|
|
79
|
+
"@hexclave/shared": "1.0.75"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@types/react": ">=18.0.0",
|
|
@@ -12,16 +12,12 @@ import { Spinner, cn } from "@hexclave/ui";
|
|
|
12
12
|
import { useEffect, useRef, useState } from "react";
|
|
13
13
|
import { useStackApp } from "..";
|
|
14
14
|
import { MaybeFullPage } from "../components/elements/maybe-full-page";
|
|
15
|
-
import { StyledLink } from "../components/link";
|
|
16
15
|
import { hexclaveAppInternalsSymbol } from "../lib/hexclave-app/common";
|
|
17
|
-
import { useTranslation } from "../lib/translations";
|
|
18
16
|
import { ErrorPage } from "./error-page";
|
|
19
17
|
|
|
20
18
|
export function OAuthCallback({ fullPage }: { fullPage?: boolean }) {
|
|
21
|
-
const { t } = useTranslation();
|
|
22
19
|
const app = useStackApp();
|
|
23
20
|
const called = useRef(false);
|
|
24
|
-
const [showRedirectLink, setShowRedirectLink] = useState(false);
|
|
25
21
|
const [errorSearchParams, setErrorSearchParams] = useState<Record<string, string> | null>(null);
|
|
26
22
|
|
|
27
23
|
useEffect(() => runAsynchronously(async () => {
|
|
@@ -51,10 +47,6 @@ export function OAuthCallback({ fullPage }: { fullPage?: boolean }) {
|
|
|
51
47
|
}
|
|
52
48
|
}), [app]);
|
|
53
49
|
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
setTimeout(() => setShowRedirectLink(true), 3000);
|
|
56
|
-
}, []);
|
|
57
|
-
|
|
58
50
|
if (errorSearchParams != null) {
|
|
59
51
|
return <ErrorPage searchParams={errorSearchParams} fullPage={fullPage} />;
|
|
60
52
|
}
|
|
@@ -73,14 +65,6 @@ export function OAuthCallback({ fullPage }: { fullPage?: boolean }) {
|
|
|
73
65
|
<div className="flex flex-col justify-center items-center gap-4">
|
|
74
66
|
<Spinner size={20} />
|
|
75
67
|
</div>
|
|
76
|
-
{showRedirectLink ? <p>{t('If you are not redirected automatically, ')}<StyledLink
|
|
77
|
-
className="whitespace-nowrap"
|
|
78
|
-
href="#"
|
|
79
|
-
onClick={(e) => {
|
|
80
|
-
e.preventDefault();
|
|
81
|
-
runAsynchronously(app.redirectToHome());
|
|
82
|
-
}}
|
|
83
|
-
>{t("click here")}</StyledLink></p> : null}
|
|
84
68
|
</div>
|
|
85
69
|
</MaybeFullPage>
|
|
86
70
|
);
|
package/src/lib/auth.test.ts
CHANGED
|
@@ -32,7 +32,7 @@ function createTestInterface() {
|
|
|
32
32
|
|
|
33
33
|
describe("getNewOAuthProviderOrScopeUrl", () => {
|
|
34
34
|
it("returns the OAuth URL without performing navigation", async () => {
|
|
35
|
-
window.history.replaceState({}, "", "/account?after_auth_return_to=%2Fsettings");
|
|
35
|
+
window.history.replaceState({}, "", "/account?after_auth_return_to=%2Fsettings#connected-accounts");
|
|
36
36
|
|
|
37
37
|
const iface = createTestInterface();
|
|
38
38
|
const session = iface.createSession({ refreshToken: null, accessToken: null });
|
|
@@ -52,7 +52,7 @@ describe("getNewOAuthProviderOrScopeUrl", () => {
|
|
|
52
52
|
expect(`${url.origin}${url.pathname}`).toBe("https://api.example.com/api/v1/auth/oauth/authorize/github");
|
|
53
53
|
expect(Object.fromEntries(url.searchParams.entries())).toMatchInlineSnapshot(`
|
|
54
54
|
{
|
|
55
|
-
"after_callback_redirect_url": "http://localhost:3000/account?after_auth_return_to=%2Fsettings",
|
|
55
|
+
"after_callback_redirect_url": "http://localhost:3000/account?after_auth_return_to=%2Fsettings#connected-accounts",
|
|
56
56
|
"client_id": "00000000-0000-4000-8000-000000000000",
|
|
57
57
|
"client_secret": "pck_test",
|
|
58
58
|
"code_challenge": "<stripped code challenge>",
|
package/src/lib/auth.ts
CHANGED
|
@@ -24,7 +24,9 @@ export async function getNewOAuthProviderOrScopeUrl(
|
|
|
24
24
|
provider: options.provider,
|
|
25
25
|
redirectUrl: constructRedirectUrl(options.redirectUrl, "redirectUrl"),
|
|
26
26
|
errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, "errorRedirectUrl"),
|
|
27
|
-
|
|
27
|
+
// Unlike callback URLs, this is the final user-facing location and may legitimately use a
|
|
28
|
+
// fragment for an account-settings tab. Preserve it exactly.
|
|
29
|
+
afterCallbackRedirectUrl: window.location.href,
|
|
28
30
|
codeChallenge,
|
|
29
31
|
state,
|
|
30
32
|
type: "link",
|
package/src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
//===========================================
|
|
3
|
+
// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template
|
|
4
|
+
//===========================================
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { hexclaveAppInternalsSymbol } from "../../common";
|
|
7
|
+
import { HexclaveClientApp, HexclaveClientAppConstructorOptions, HexclaveClientAppJson } from "../interfaces/client-app";
|
|
8
|
+
|
|
9
|
+
const baseOptions = {
|
|
10
|
+
baseUrl: "http://localhost:12345",
|
|
11
|
+
projectId: "00000000-0000-4000-8000-000000000000",
|
|
12
|
+
publishableClientKey: "stack-pk-test",
|
|
13
|
+
tokenStore: "memory",
|
|
14
|
+
redirectMethod: "none",
|
|
15
|
+
} satisfies HexclaveClientAppConstructorOptions<true, string>;
|
|
16
|
+
|
|
17
|
+
describe("HexclaveClientApp automatic side effects", () => {
|
|
18
|
+
it("does not inspect browser state when disabled", () => {
|
|
19
|
+
const previousWindow = Reflect.get(globalThis, "window");
|
|
20
|
+
const previousDocument = Reflect.get(globalThis, "document");
|
|
21
|
+
const hadPreviousWindow = Reflect.has(globalThis, "window");
|
|
22
|
+
const hadPreviousDocument = Reflect.has(globalThis, "document");
|
|
23
|
+
const browserGlobal = {};
|
|
24
|
+
Object.defineProperty(browserGlobal, "location", {
|
|
25
|
+
get() {
|
|
26
|
+
throw new Error("Construction must not inspect the current URL when automatic side effects are disabled");
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
Reflect.set(globalThis, "window", browserGlobal);
|
|
31
|
+
Object.defineProperty(globalThis, "document", {
|
|
32
|
+
configurable: true,
|
|
33
|
+
get() {
|
|
34
|
+
throw new Error("Construction must not access the document when automatic side effects are disabled");
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
expect(() => new HexclaveClientApp({
|
|
40
|
+
...baseOptions,
|
|
41
|
+
automaticSideEffects: false,
|
|
42
|
+
})).not.toThrow();
|
|
43
|
+
} finally {
|
|
44
|
+
if (hadPreviousWindow) {
|
|
45
|
+
Reflect.set(globalThis, "window", previousWindow);
|
|
46
|
+
} else {
|
|
47
|
+
Reflect.deleteProperty(globalThis, "window");
|
|
48
|
+
}
|
|
49
|
+
if (hadPreviousDocument) {
|
|
50
|
+
Object.defineProperty(globalThis, "document", {
|
|
51
|
+
configurable: true,
|
|
52
|
+
value: previousDocument,
|
|
53
|
+
writable: true,
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
Reflect.deleteProperty(globalThis, "document");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("does not initialize automatic side effects when disabled", () => {
|
|
62
|
+
const methodName = "_initializeAutomaticSideEffects";
|
|
63
|
+
const originalInitializer = Reflect.get(HexclaveClientApp.prototype, methodName);
|
|
64
|
+
let initializationCalls = 0;
|
|
65
|
+
Reflect.set(HexclaveClientApp.prototype, methodName, () => {
|
|
66
|
+
initializationCalls += 1;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
new HexclaveClientApp({
|
|
71
|
+
...baseOptions,
|
|
72
|
+
automaticSideEffects: false,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
expect(initializationCalls).toBe(0);
|
|
76
|
+
} finally {
|
|
77
|
+
Reflect.set(HexclaveClientApp.prototype, methodName, originalInitializer);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it.each([undefined, true])("retains automatic initialization when automaticSideEffects is %s", (automaticSideEffects) => {
|
|
82
|
+
const methodName = "_initializeAutomaticSideEffects";
|
|
83
|
+
const originalInitializer = Reflect.get(HexclaveClientApp.prototype, methodName);
|
|
84
|
+
let initializationCalls = 0;
|
|
85
|
+
Reflect.set(HexclaveClientApp.prototype, methodName, () => {
|
|
86
|
+
initializationCalls += 1;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
new HexclaveClientApp({
|
|
91
|
+
...baseOptions,
|
|
92
|
+
automaticSideEffects,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
expect(initializationCalls).toBe(1);
|
|
96
|
+
} finally {
|
|
97
|
+
Reflect.set(HexclaveClientApp.prototype, methodName, originalInitializer);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("preserves the option through serialization", () => {
|
|
102
|
+
const app = new HexclaveClientApp({
|
|
103
|
+
...baseOptions,
|
|
104
|
+
automaticSideEffects: false,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
expect(app[hexclaveAppInternalsSymbol].toClientJson().automaticSideEffects).toBe(false);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("preserves stable identity when deserializing with automatic side effects disabled", () => {
|
|
111
|
+
const json: HexclaveClientAppJson<false, string> = {
|
|
112
|
+
baseUrl: baseOptions.baseUrl,
|
|
113
|
+
projectId: baseOptions.projectId,
|
|
114
|
+
publishableClientKey: baseOptions.publishableClientKey,
|
|
115
|
+
tokenStore: null,
|
|
116
|
+
redirectMethod: baseOptions.redirectMethod,
|
|
117
|
+
automaticSideEffects: false,
|
|
118
|
+
uniqueIdentifier: "00000000-0000-4000-8000-000000000001",
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const first = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);
|
|
122
|
+
const second = HexclaveClientApp[hexclaveAppInternalsSymbol].fromClientJson(json);
|
|
123
|
+
|
|
124
|
+
expect(second).toBe(first);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -7,6 +7,7 @@ import { AccessToken } from "@hexclave/shared/dist/sessions";
|
|
|
7
7
|
import { Store } from "@hexclave/shared/dist/utils/stores";
|
|
8
8
|
import { hexclaveAppInternalsSymbol } from "../../common";
|
|
9
9
|
import { StackClientApp } from "../interfaces/client-app";
|
|
10
|
+
import { planRedirectToHandler } from "./redirect-page-urls";
|
|
10
11
|
|
|
11
12
|
function createAccessTokenString(refreshTokenId: string): string {
|
|
12
13
|
const encode = (value: unknown) => Buffer.from(JSON.stringify(value)).toString("base64url");
|
|
@@ -54,6 +55,76 @@ function createMockDocument(): Document {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
describe("StackClientApp cross-domain auth", () => {
|
|
58
|
+
it("keeps noRedirectBack same-domain redirects free of redirect-back state", async () => {
|
|
59
|
+
const redirectPlan = await planRedirectToHandler({
|
|
60
|
+
handlerName: "signIn",
|
|
61
|
+
rawHandlerUrl: "/handler/sign-in",
|
|
62
|
+
noRedirectBack: true,
|
|
63
|
+
currentUrl: new URL("https://app.example.test/settings?tab=profile"),
|
|
64
|
+
localOAuthCallbackUrl: "/handler/oauth-callback",
|
|
65
|
+
rawHomeUrl: "/home",
|
|
66
|
+
getCrossDomainHandoffParams: async () => {
|
|
67
|
+
throw new Error("Same-domain redirects must not create cross-domain handoff parameters.");
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
expect(redirectPlan).toEqual({
|
|
72
|
+
type: "redirect",
|
|
73
|
+
url: "/handler/sign-in",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("returns noRedirectBack cross-domain auth to the source app home", async () => {
|
|
78
|
+
const handoffState = "no-redirect-back-state";
|
|
79
|
+
const handoffCodeChallenge = "abcdefghijklmnopqrstuvwxyzABCDEFG_0123456789-._~";
|
|
80
|
+
const currentUrl = new URL("https://app.example.test/settings?tab=profile");
|
|
81
|
+
currentUrl.searchParams.set("hexclave_cross_domain_state", handoffState);
|
|
82
|
+
currentUrl.searchParams.set("hexclave_cross_domain_code_challenge", handoffCodeChallenge);
|
|
83
|
+
currentUrl.searchParams.set(
|
|
84
|
+
"hexclave_cross_domain_after_callback_redirect_url",
|
|
85
|
+
"https://app.example.test/settings?tab=profile",
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const redirectPlan = await planRedirectToHandler({
|
|
89
|
+
handlerName: "signIn",
|
|
90
|
+
rawHandlerUrl: "https://auth.example.test/handler/sign-in",
|
|
91
|
+
noRedirectBack: true,
|
|
92
|
+
currentUrl,
|
|
93
|
+
localOAuthCallbackUrl: "/handler/oauth-callback",
|
|
94
|
+
rawHomeUrl: "/home",
|
|
95
|
+
getCrossDomainHandoffParams: async () => {
|
|
96
|
+
throw new Error("Existing cross-domain handoff parameters must be reused.");
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
expect(redirectPlan.type).toBe("redirect");
|
|
101
|
+
if (redirectPlan.type !== "redirect") {
|
|
102
|
+
throw new Error("Expected noRedirectBack sign-in to produce a redirect URL.");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const hostedUrl = new URL(redirectPlan.url);
|
|
106
|
+
expect(hostedUrl.origin).toBe("https://auth.example.test");
|
|
107
|
+
expect(hostedUrl.pathname).toBe("/handler/sign-in");
|
|
108
|
+
expect(hostedUrl.searchParams.get("hexclave_cross_domain_after_callback_redirect_url")).toBe(
|
|
109
|
+
"https://app.example.test/home",
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const rawSourceCallbackUrl = hostedUrl.searchParams.get("after_auth_return_to");
|
|
113
|
+
if (rawSourceCallbackUrl == null) {
|
|
114
|
+
throw new Error("Expected cross-domain noRedirectBack to include its internal source callback URL.");
|
|
115
|
+
}
|
|
116
|
+
const sourceCallbackUrl = new URL(rawSourceCallbackUrl);
|
|
117
|
+
expect(sourceCallbackUrl.origin).toBe("https://app.example.test");
|
|
118
|
+
expect(sourceCallbackUrl.pathname).toBe("/handler/oauth-callback");
|
|
119
|
+
expect(sourceCallbackUrl.searchParams.get("hexclave_cross_domain_auth")).toBe("1");
|
|
120
|
+
expect(sourceCallbackUrl.searchParams.get("hexclave_cross_domain_state")).toBe(handoffState);
|
|
121
|
+
expect(sourceCallbackUrl.searchParams.get("hexclave_cross_domain_code_challenge")).toBe(handoffCodeChallenge);
|
|
122
|
+
expect(sourceCallbackUrl.searchParams.get("hexclave_cross_domain_after_callback_redirect_url")).toBe(
|
|
123
|
+
"https://app.example.test/home",
|
|
124
|
+
);
|
|
125
|
+
expect(sourceCallbackUrl.toString()).not.toContain("/settings");
|
|
126
|
+
});
|
|
127
|
+
|
|
57
128
|
it("exposes redirect-back-aware handler URLs for devtool previews", async () => {
|
|
58
129
|
const previousWindow = Reflect.get(globalThis, "window");
|
|
59
130
|
const hadPreviousWindow = Reflect.has(globalThis, "window");
|
|
@@ -486,6 +557,8 @@ describe("StackClientApp cross-domain auth", () => {
|
|
|
486
557
|
callbackUrl.searchParams.set("details", JSON.stringify({
|
|
487
558
|
message: "Your sign up was rejected by an administrator's sign-up rule.",
|
|
488
559
|
}));
|
|
560
|
+
callbackUrl.searchParams.set("after_auth_return_to", "/dashboard");
|
|
561
|
+
callbackUrl.searchParams.set("after_callback_redirect_url", "https://customer.example.test/settings?tab=connected-accounts");
|
|
489
562
|
let currentHref = callbackUrl.toString();
|
|
490
563
|
let redirectedUrl = "";
|
|
491
564
|
const redirectSpy = vi.spyOn(StackClientApp.prototype as any, "_redirectTo").mockImplementation(async (...args: unknown[]) => {
|
|
@@ -539,6 +612,8 @@ describe("StackClientApp cross-domain auth", () => {
|
|
|
539
612
|
expect(errorUrl.pathname).toBe("/handler/error");
|
|
540
613
|
expect(errorUrl.searchParams.get("errorCode")).toBe("SIGN_UP_REJECTED");
|
|
541
614
|
expect(errorUrl.searchParams.get("message")).toBe("Your sign up was rejected by an administrator's sign-up rule.");
|
|
615
|
+
expect(errorUrl.searchParams.get("after_auth_return_to")).toBe("/dashboard");
|
|
616
|
+
expect(errorUrl.searchParams.get("after_callback_redirect_url")).toBe("https://customer.example.test/settings?tab=connected-accounts");
|
|
542
617
|
expect(new URL(currentHref).searchParams.has("errorCode")).toBe(false);
|
|
543
618
|
});
|
|
544
619
|
|