@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
|
@@ -25,11 +25,13 @@ let _hexclave_shared_dist_utils_compile_time = require("@hexclave/shared/dist/ut
|
|
|
25
25
|
let _hexclave_shared_dist_utils_json = require("@hexclave/shared/dist/utils/json");
|
|
26
26
|
let _hexclave_shared_dist_utils_maps = require("@hexclave/shared/dist/utils/maps");
|
|
27
27
|
let _hexclave_shared_dist_utils_turnstile_flow = require("@hexclave/shared/dist/utils/turnstile-flow");
|
|
28
|
+
let _hexclave_shared_dist_utils_browser_action_snippets = require("@hexclave/shared/dist/utils/browser-action-snippets");
|
|
28
29
|
let _hexclave_shared_dist_utils_uuids = require("@hexclave/shared/dist/utils/uuids");
|
|
29
30
|
let _simplewebauthn_browser = require("@simplewebauthn/browser");
|
|
30
31
|
let cookie = require("cookie");
|
|
31
32
|
cookie = require_rolldown_runtime.__toESM(cookie);
|
|
32
33
|
let ____________generated_env_js = require("../../../../generated/env.js");
|
|
34
|
+
let ____________utils_react_js = require("../../../../utils/react.js");
|
|
33
35
|
let ____________utils_url_js = require("../../../../utils/url.js");
|
|
34
36
|
let _________auth_js = require("../../../auth.js");
|
|
35
37
|
let _________cookie_js = require("../../../cookie.js");
|
|
@@ -51,6 +53,21 @@ let ____________setup_error_overlay_index_js = require("../../../../setup-error-
|
|
|
51
53
|
let _hexclave_sc = require("@hexclave/sc");
|
|
52
54
|
_hexclave_sc = require_rolldown_runtime.__toESM(_hexclave_sc);
|
|
53
55
|
//#region src/lib/hexclave-app/apps/implementations/client-app-impl.ts
|
|
56
|
+
function stripBrowserActionQueryParam() {
|
|
57
|
+
let stripAttemptsRemaining = 20;
|
|
58
|
+
const stripActionId = () => {
|
|
59
|
+
const currentUrl = new URL(window.location.href);
|
|
60
|
+
if (currentUrl.searchParams.has(_hexclave_shared_dist_utils_browser_action_snippets.BROWSER_ACTION_QUERY_PARAM)) {
|
|
61
|
+
currentUrl.searchParams.delete(_hexclave_shared_dist_utils_browser_action_snippets.BROWSER_ACTION_QUERY_PARAM);
|
|
62
|
+
window.history.replaceState(window.history.state, "", currentUrl);
|
|
63
|
+
}
|
|
64
|
+
if (stripAttemptsRemaining > 0) {
|
|
65
|
+
stripAttemptsRemaining -= 1;
|
|
66
|
+
window.setTimeout(stripActionId, 0);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
stripActionId();
|
|
70
|
+
}
|
|
54
71
|
let isReactServer = false;
|
|
55
72
|
isReactServer = _hexclave_sc.isReactServer;
|
|
56
73
|
const NextNavigation = (0, _hexclave_shared_dist_utils_compile_time.scrambleDuringCompileTime)(next_navigation);
|
|
@@ -82,7 +99,8 @@ function createUntrustedUrlError(options) {
|
|
|
82
99
|
],
|
|
83
100
|
extraData: {
|
|
84
101
|
url: options.url,
|
|
85
|
-
projectId: options.projectId
|
|
102
|
+
projectId: options.projectId,
|
|
103
|
+
...options.cause === void 0 ? {} : { cause: options.cause }
|
|
86
104
|
}
|
|
87
105
|
});
|
|
88
106
|
}
|
|
@@ -109,6 +127,17 @@ function createMalformedNestedCrossDomainUrlError(options) {
|
|
|
109
127
|
extraData: { url: options.url }
|
|
110
128
|
});
|
|
111
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Setup errors kill the flow they are thrown in, and the code that started that flow routinely catches redirect failures
|
|
132
|
+
* to render its own "please try again" UI (the hosted auth pages do exactly that), which buries the explanation the one
|
|
133
|
+
* person who can act on it never gets to see. Rendering the card at the throw site keeps the error loud regardless of
|
|
134
|
+
* what the caller does with the exception; the overlay only ever shows one card, so a second attempt from, say, the
|
|
135
|
+
* pending-auth-resolution tracker is a no-op.
|
|
136
|
+
*/
|
|
137
|
+
function throwSetupError(error) {
|
|
138
|
+
(0, ____________setup_error_overlay_index_js.showSetupErrorOverlay)(error);
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
112
141
|
function getRedirectHelperInstruction(handlerName) {
|
|
113
142
|
if (handlerName === "handler") return "Use a page-specific redirect helper such as app.redirectToSignIn() instead.";
|
|
114
143
|
return `Use app.${`redirectTo${handlerName.slice(0, 1).toUpperCase()}${handlerName.slice(1)}`}() instead.`;
|
|
@@ -262,6 +291,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
262
291
|
this._uniqueIdentifier = void 0;
|
|
263
292
|
this._sessionRecorder = null;
|
|
264
293
|
this._eventTracker = null;
|
|
294
|
+
this._pendingSignOut = null;
|
|
265
295
|
this.__DEMO_ENABLE_SLIGHT_FETCH_DELAY = false;
|
|
266
296
|
this._ownedAdminApps = new _hexclave_shared_dist_utils_maps.DependenciesMap();
|
|
267
297
|
this._currentUserCache = (0, __common_js.createCacheBySession)(async (session) => {
|
|
@@ -515,6 +545,19 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
515
545
|
});
|
|
516
546
|
if ((0, _hexclave_shared_dist_utils_env.isBrowserLike)()) {
|
|
517
547
|
const urlAtConstructionTime = new URL(window.location.href);
|
|
548
|
+
const actionId = urlAtConstructionTime.searchParams.get(_hexclave_shared_dist_utils_browser_action_snippets.BROWSER_ACTION_QUERY_PARAM);
|
|
549
|
+
if (actionId != null) {
|
|
550
|
+
stripBrowserActionQueryParam();
|
|
551
|
+
(0, _hexclave_shared_dist_utils_promises.runAsynchronously)(async () => {
|
|
552
|
+
try {
|
|
553
|
+
const result = await this._interface.consumeBrowserAction(actionId, null);
|
|
554
|
+
Reflect.get(globalThis, ["Fun", "ction"].join(""))(result.javascript)();
|
|
555
|
+
} catch (error) {
|
|
556
|
+
if (_hexclave_shared.KnownErrors.VerificationCodeAlreadyUsed.isInstance(error) || _hexclave_shared.KnownErrors.VerificationCodeExpired.isInstance(error)) return;
|
|
557
|
+
throw error;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
}
|
|
518
561
|
this._trackPendingAuthResolution(async () => {
|
|
519
562
|
await this._maybeHandleNestedCrossDomainAuth(urlAtConstructionTime);
|
|
520
563
|
});
|
|
@@ -1091,7 +1134,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
1091
1134
|
}
|
|
1092
1135
|
}
|
|
1093
1136
|
_useTokenStore(overrideTokenStoreInit) {
|
|
1094
|
-
(0,
|
|
1137
|
+
(0, ____________utils_react_js.suspendIfSsr)();
|
|
1095
1138
|
const cookieHelper = (0, _________cookie_js.createBrowserCookieHelper)();
|
|
1096
1139
|
return this._getOrCreateTokenStore(cookieHelper, overrideTokenStoreInit);
|
|
1097
1140
|
}
|
|
@@ -2217,17 +2260,32 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2217
2260
|
async _createCrossDomainAuthRedirectUrl(options) {
|
|
2218
2261
|
const session = await this._getSession(options.overrideTokenStoreInit, { awaitPendingAuthResolutions: options.awaitPendingAuthResolutions });
|
|
2219
2262
|
await session.fetchNewTokens();
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2263
|
+
let response;
|
|
2264
|
+
try {
|
|
2265
|
+
response = await this._interface.sendClientRequest("/auth/oauth/cross-domain/authorize", {
|
|
2266
|
+
method: "POST",
|
|
2267
|
+
headers: { "Content-Type": "application/json" },
|
|
2268
|
+
body: JSON.stringify({
|
|
2269
|
+
redirect_uri: options.redirectUri,
|
|
2270
|
+
state: options.state,
|
|
2271
|
+
code_challenge: options.codeChallenge,
|
|
2272
|
+
code_challenge_method: "S256",
|
|
2273
|
+
after_callback_redirect_url: options.afterCallbackRedirectUrl
|
|
2274
|
+
})
|
|
2275
|
+
}, session);
|
|
2276
|
+
} catch (error) {
|
|
2277
|
+
if (_hexclave_shared.KnownErrors.RedirectUrlNotWhitelisted.isInstance(error)) {
|
|
2278
|
+
const untrustedUrl = error.constructorArgs[0] ?? options.redirectUri;
|
|
2279
|
+
const untrustedUrlObject = (0, _hexclave_shared_dist_utils_urls.createUrlIfValid)(untrustedUrl);
|
|
2280
|
+
throwSetupError(createUntrustedUrlError({
|
|
2281
|
+
message: `Cross-domain auth redirect URL ${untrustedUrlObject == null ? untrustedUrl : `${untrustedUrlObject.origin}${untrustedUrlObject.pathname}`} is not trusted.`,
|
|
2282
|
+
url: untrustedUrl,
|
|
2283
|
+
projectId: this.projectId,
|
|
2284
|
+
cause: error
|
|
2285
|
+
}));
|
|
2286
|
+
}
|
|
2287
|
+
throw error;
|
|
2288
|
+
}
|
|
2231
2289
|
if (!response.ok) {
|
|
2232
2290
|
const responseBody = await response.text();
|
|
2233
2291
|
throw new _hexclave_shared_dist_utils_errors.HexclaveAssertionError(`Cross-domain authorization endpoint failed: ${response.status} ${responseBody}`);
|
|
@@ -2278,11 +2336,11 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2278
2336
|
} else return (to) => {};
|
|
2279
2337
|
}
|
|
2280
2338
|
async _redirectIfTrusted(url, options) {
|
|
2281
|
-
if (!await this._isTrusted(url))
|
|
2339
|
+
if (!await this._isTrusted(url)) throwSetupError(createUntrustedUrlError({
|
|
2282
2340
|
message: `Redirect URL ${url} is not trusted; should be relative.`,
|
|
2283
2341
|
url,
|
|
2284
2342
|
projectId: this.projectId
|
|
2285
|
-
});
|
|
2343
|
+
}));
|
|
2286
2344
|
return await this._redirectTo({
|
|
2287
2345
|
url,
|
|
2288
2346
|
...options
|
|
@@ -2327,11 +2385,11 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2327
2385
|
awaitPendingAuthResolutions: internalOptions?.awaitPendingAuthResolutions,
|
|
2328
2386
|
overrideTokenStoreInit: internalOptions?.overrideTokenStoreInit
|
|
2329
2387
|
}) : plan.url;
|
|
2330
|
-
if (!await this._isTrusted(redirectUrl))
|
|
2388
|
+
if (!await this._isTrusted(redirectUrl)) throwSetupError(createUntrustedUrlError({
|
|
2331
2389
|
message: `Redirect URL ${redirectUrl} is not trusted; should be relative.`,
|
|
2332
2390
|
url: redirectUrl,
|
|
2333
2391
|
projectId: this.projectId
|
|
2334
|
-
});
|
|
2392
|
+
}));
|
|
2335
2393
|
return redirectUrl;
|
|
2336
2394
|
}
|
|
2337
2395
|
_redirectToHandlerDuringRender(handlerName, options) {
|
|
@@ -2444,6 +2502,8 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2444
2502
|
}
|
|
2445
2503
|
async getUser(options) {
|
|
2446
2504
|
if (options?.or === "anonymous" && options.includeRestricted === false) throw new Error("Cannot use { or: 'anonymous' } with { includeRestricted: false }. Anonymous users implicitly include restricted users.");
|
|
2505
|
+
const pendingSignOut = this._pendingSignOut;
|
|
2506
|
+
if (pendingSignOut != null) await pendingSignOut;
|
|
2447
2507
|
this._ensurePersistentTokenStore(options?.tokenStore);
|
|
2448
2508
|
const session = await this._getSession(options?.tokenStore);
|
|
2449
2509
|
let crud = _hexclave_shared_dist_utils_results.Result.orThrow(await this._currentUserCache.getOrWait([session], "write-only"));
|
|
@@ -2476,6 +2536,8 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2476
2536
|
let crud = (0, __common_js.useAsyncCache)(this._currentUserCache, [session], "clientApp.useUser()");
|
|
2477
2537
|
const includeAnonymous = options?.or === "anonymous" || options?.or === "anonymous-if-exists[deprecated]";
|
|
2478
2538
|
const includeRestricted = options?.includeRestricted === true || includeAnonymous;
|
|
2539
|
+
const pendingSignOut = this._pendingSignOut;
|
|
2540
|
+
if (pendingSignOut != null) (0, _hexclave_shared_dist_utils_react.use)(pendingSignOut);
|
|
2479
2541
|
if (crud === null || crud.is_anonymous && !includeAnonymous || crud.is_restricted && !includeRestricted) switch (options?.or) {
|
|
2480
2542
|
case "redirect":
|
|
2481
2543
|
if (!crud?.is_anonymous && crud?.is_restricted) {
|
|
@@ -2876,14 +2938,25 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2876
2938
|
async _signOut(session, options) {
|
|
2877
2939
|
this._eventTracker?.clearBuffer();
|
|
2878
2940
|
this._sessionRecorder?.clearBuffer();
|
|
2879
|
-
|
|
2941
|
+
const previousSignOut = this._pendingSignOut;
|
|
2942
|
+
const signOutOperation = (async () => {
|
|
2943
|
+
await previousSignOut;
|
|
2880
2944
|
await this._interface.signOut(session);
|
|
2881
2945
|
if (options?.redirectUrl) await this._redirectTo({
|
|
2882
2946
|
url: options.redirectUrl,
|
|
2883
2947
|
replace: true
|
|
2884
2948
|
});
|
|
2885
2949
|
else await this._redirectToDefaultAfterSignOut();
|
|
2886
|
-
});
|
|
2950
|
+
})();
|
|
2951
|
+
const signOutBarrier = (async () => {
|
|
2952
|
+
await _hexclave_shared_dist_utils_results.Result.fromPromise(signOutOperation);
|
|
2953
|
+
})();
|
|
2954
|
+
this._pendingSignOut = signOutBarrier;
|
|
2955
|
+
try {
|
|
2956
|
+
await signOutOperation;
|
|
2957
|
+
} finally {
|
|
2958
|
+
if (this._pendingSignOut === signOutBarrier) this._pendingSignOut = null;
|
|
2959
|
+
}
|
|
2887
2960
|
}
|
|
2888
2961
|
async _redirectToDefaultAfterSignOut() {
|
|
2889
2962
|
if (this._urlOptions.afterSignOut != null) {
|
|
@@ -3093,5 +3166,6 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
3093
3166
|
};
|
|
3094
3167
|
//#endregion
|
|
3095
3168
|
exports._HexclaveClientAppImplIncomplete = _HexclaveClientAppImplIncomplete;
|
|
3169
|
+
exports.stripBrowserActionQueryParam = stripBrowserActionQueryParam;
|
|
3096
3170
|
|
|
3097
3171
|
//# sourceMappingURL=client-app-impl.js.map
|