@sanity/sdk-react 3.5.0-next.20260922190712 → 3.5.0-next.20260922191653
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -24
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/auth/AuthBoundary.test.tsx +81 -2
- package/src/components/auth/AuthBoundary.tsx +17 -3
- package/src/components/auth/LoginCallback.test.tsx +72 -7
- package/src/components/auth/LoginCallback.tsx +32 -4
- package/src/hooks/auth/useHandleOAuthCallback.tsx +16 -13
package/dist/index.d.ts
CHANGED
|
@@ -1103,31 +1103,34 @@ export declare const useHandleAuthCallback: () => (locationHref?: string | undef
|
|
|
1103
1103
|
* function invokes core's `handleOAuthCallback`, which validates the `state`
|
|
1104
1104
|
* parameter, surfaces `?error=` redirects, exchanges the authorization `code`
|
|
1105
1105
|
* for tokens, persists them, and transitions the auth state to `LOGGED_IN` —
|
|
1106
|
-
* all in core.
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1106
|
+
* all in core. On success it resolves the same-origin location the user was on
|
|
1107
|
+
* when the flow started (so deep links survive login), otherwise the callback
|
|
1108
|
+
* URL cleaned of the OAuth params (`code`, `state`, `error`,
|
|
1109
|
+
* `error_description`). It resolves `false` when there was nothing to handle.
|
|
1110
|
+
* The resolved URL may be a different route, so navigate to it rather than
|
|
1111
|
+
* only calling `history.replaceState`.
|
|
1112
|
+
*
|
|
1113
|
+
* `AuthBoundary` runs this for you when the app lands on the OAuth redirect
|
|
1114
|
+
* URI. Reach for this hook only when building a custom callback component.
|
|
1109
1115
|
*
|
|
1110
1116
|
* Concurrent calls are single-flight in core, so React StrictMode's double
|
|
1111
|
-
* invocation will not trigger a second code exchange
|
|
1112
|
-
*
|
|
1113
|
-
* state validation and moves the auth state to `ERROR`, so apply the returned
|
|
1114
|
-
* URL before the component can remount.
|
|
1117
|
+
* invocation will not trigger a second code exchange, and a repeated call with
|
|
1118
|
+
* a stale callback URL is ignored once a session is established.
|
|
1115
1119
|
*
|
|
1116
1120
|
* @example
|
|
1117
1121
|
* ```tsx
|
|
1118
1122
|
* function OAuthCallback() {
|
|
1119
1123
|
* const handleCallback = useHandleOAuthCallback()
|
|
1124
|
+
* const navigate = useNavigate() // your router's navigation
|
|
1120
1125
|
*
|
|
1121
1126
|
* useEffect(() => {
|
|
1122
1127
|
* handleCallback(window.location.href)
|
|
1123
|
-
* .then((
|
|
1124
|
-
*
|
|
1125
|
-
*
|
|
1126
|
-
* history.replaceState(null, '', cleanedUrl)
|
|
1127
|
-
* }
|
|
1128
|
+
* .then((nextUrl) => {
|
|
1129
|
+
* // Returns the user to where they started, with OAuth params removed
|
|
1130
|
+
* if (nextUrl) navigate(nextUrl, {replace: true})
|
|
1128
1131
|
* })
|
|
1129
1132
|
* .catch(console.error)
|
|
1130
|
-
* }, [handleCallback])
|
|
1133
|
+
* }, [handleCallback, navigate])
|
|
1131
1134
|
*
|
|
1132
1135
|
* return <div>Completing sign-in…</div>
|
|
1133
1136
|
* }
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/auth/LoginError.tsx","../src/components/auth/AuthBoundary.tsx","../src/components/SanityApp.tsx","../src/components/SDKProvider.tsx","../src/config/handles.ts","../src/context/ComlinkTokenRefresh.tsx","../src/context/renderSanityApp.tsx","../src/context/ResourceProvider.tsx","../src/context/SanityInstanceProvider.tsx","../src/context/SDKStudioContext.ts","../src/hooks/helpers/createFetcherHook.ts","../src/hooks/access/useCheckPermissions.ts","../src/hooks/agent/agentActions.ts","../src/hooks/applications/useApplication.ts","../src/hooks/applications/useApplications.ts","../src/hooks/helpers/createMutationHook.tsx","../src/hooks/applications/useDeleteApplication.ts","../src/hooks/applications/useUpdateApplication.ts","../src/hooks/auth/useAuthState.tsx","../src/hooks/auth/useAuthToken.tsx","../src/hooks/auth/useCurrentUser.tsx","../src/hooks/auth/useHandleAuthCallback.tsx","../src/hooks/auth/useHandleOAuthCallback.tsx","../src/hooks/auth/useLoginUrl.tsx","../src/hooks/auth/useLogOut.tsx","../src/hooks/auth/useOAuthAuthorize.tsx","../src/hooks/auth/useOAuthTokens.tsx","../src/hooks/auth/useVerifyOrgProjects.tsx","../src/hooks/client/useClient.ts","../../../node_modules/.pnpm/xstate@5.32.6/node_modules/xstate/dist/declarations/src/index.d.ts","../../../node_modules/.pnpm/@sanity+comlink@4.0.3/node_modules/@sanity/comlink/dist/index.d.ts","../src/hooks/comlink/useFrameConnection.ts","../src/hooks/comlink/useWindowConnection.ts","../src/hooks/helpers/useNormalizedResourceOptions.ts","../src/hooks/comments/useCommentActions.ts","../src/hooks/comments/useComments.ts","../src/hooks/comments/useCommentThreads.ts","../src/hooks/context/useResource.ts","../src/hooks/context/useSanityInstance.ts","../src/hooks/dashboard/useFavoriteContext.ts","../src/hooks/dashboard/useFavorite.ts","../src/hooks/dashboard/useRecordDocumentHistoryEvent.ts","../src/hooks/dashboard/useStudioWorkspacesByProjectIdDataset.ts","../src/hooks/dashboard/useUpdateFavorite.ts","../src/hooks/datasets/useDatasets.ts","../src/hooks/document/useApplyDocumentActions.ts","../src/hooks/document/useCreateDocument.ts","../src/hooks/document/useDocument.ts","../src/hooks/document/useDocumentEvent.ts","../src/hooks/document/useDocumentPermissions.ts","../src/hooks/document/useDocumentSyncStatus.ts","../src/hooks/document/useEditDocument.ts","../src/hooks/documents/useDocuments.ts","../src/hooks/installations/useInstallation.ts","../src/hooks/installations/useInstallations.ts","../src/hooks/organizations/useOrganization.ts","../src/hooks/organizations/useOrganizations.ts","../src/hooks/paginatedDocuments/usePaginatedDocuments.ts","../src/hooks/presence/usePresence.ts","../src/hooks/presence/usePresenceForDocument.ts","../src/hooks/presence/useReportPresence.ts","../src/hooks/preview/useDocumentPreview.tsx","../src/hooks/projection/useDocumentProjection.ts","../src/hooks/projects/useProject.ts","../src/hooks/projects/useProjects.ts","../src/hooks/query/useQuery.ts","../src/hooks/releases/useActiveReleases.ts","../src/hooks/releases/useAllReleases.ts","../src/hooks/releases/useApplyReleaseActions.ts","../src/hooks/releases/usePerspective.ts","../src/hooks/users/useUser.ts","../src/hooks/users/useUsers.ts","../src/version.ts"],"x_google_ignoreList":[29,30],"mappings":";;;;;;;;;;;;;KAoBY,kBAAkB;;;;UCkBb;;;;;EAKf,iBAAiB,MAAM;IACrB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;EAOjB,oBAAoB,MAAM;IACxB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;;EAQjB,sBAAsB,MAAM,cAAc;;EAG1C,SAAS,MAAM;;;;EAKf;;EAGA,SAAS,MAAM;;EAGf,WAAW,MAAM;;;;;;;;EASjB;;;;;;;;;;;;;;;;;;;;;;;wBAwBc,eACd,wBACG,SACF,oBAAoB,MAAM;;;;;UCpGZ;;;;;;;EAOf,SAAS,eAAe;EACxB,YAAY,eAAe;EAC3B,UAAU,MAAM;EAEhB,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqFc,YACd,UACA,UACA,QAAQ,eACL,SACF,iBAAiB;;;;UC3HH,yBAAyB;EACxC,UAAU;EACV,QAAQ,eAAe;EACvB,UAAU;EACV,YAAY,eAAe;;EAE3B;;;;;;;wBAoBc,cACd,UACA,QACA,UACA,+BACG,SACF,mBAAmB;;;;;;;;;;;;UClCL,eACf,kCACA,4CACQ,cAAc,UAAU;;;;;EAKhC;;;;;;UAOe,mBACf,uCACA,kCACA,4CACQ,qBAAuB,eAAe,UAAU;EACxD;;;;;;;;;;UAWe,eACf,uCACA,kCACA,4CACQ,iBAAmB,eAAe,UAAU;EACpD;;;;;;;qBC2EW,6BAA6B,QAAM,GAAG;UC1HzC;EACR;;;;;UAMQ;GACP,c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CACA,sCACE,wBAAwB,aAAa,QAAQ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0D3C,SACd,gCACA,kCACA,oCAEA,SAAS,gBAAgB,QAAQ,UAAU;;EAG3C,MAAM,mBAAmB,WAAW,cAAc;;EAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCc,SAAS,OAAO,SAAS,wBAAwB;;EAE/D,MAAM;;EAEN;;;;;;;;;;;;;;;;;;wBCzEc,kBACd,UAAU,wBAAwB,6BACjC;;;;;;;;;;;;;;;;;;;;;;;;;;wBCKa,eACd,UAAU,wBAAwB,6BACjC;;;;UClDO;OACH,QAAQ,gBAAgB,iBAAiB,UAAU,mBAAmB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsExE,wBAAwB;;;;;wBC1BrB,eAAe,oBAAoB;;;;;UC1ClC;;;;EAIf,MAAM;;;;EAIN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmCc,QAAQ,SAAS,iBAAiB;;;;;UCpCjC;;;;EAIf,MAAM;;;;EAIN;;;;EAKA;;;;EAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Dc,SAAS,UAAU,kBAAkB;;;;;qBCtFxC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/auth/LoginError.tsx","../src/components/auth/AuthBoundary.tsx","../src/components/SanityApp.tsx","../src/components/SDKProvider.tsx","../src/config/handles.ts","../src/context/ComlinkTokenRefresh.tsx","../src/context/renderSanityApp.tsx","../src/context/ResourceProvider.tsx","../src/context/SanityInstanceProvider.tsx","../src/context/SDKStudioContext.ts","../src/hooks/helpers/createFetcherHook.ts","../src/hooks/access/useCheckPermissions.ts","../src/hooks/agent/agentActions.ts","../src/hooks/applications/useApplication.ts","../src/hooks/applications/useApplications.ts","../src/hooks/helpers/createMutationHook.tsx","../src/hooks/applications/useDeleteApplication.ts","../src/hooks/applications/useUpdateApplication.ts","../src/hooks/auth/useAuthState.tsx","../src/hooks/auth/useAuthToken.tsx","../src/hooks/auth/useCurrentUser.tsx","../src/hooks/auth/useHandleAuthCallback.tsx","../src/hooks/auth/useHandleOAuthCallback.tsx","../src/hooks/auth/useLoginUrl.tsx","../src/hooks/auth/useLogOut.tsx","../src/hooks/auth/useOAuthAuthorize.tsx","../src/hooks/auth/useOAuthTokens.tsx","../src/hooks/auth/useVerifyOrgProjects.tsx","../src/hooks/client/useClient.ts","../../../node_modules/.pnpm/xstate@5.32.6/node_modules/xstate/dist/declarations/src/index.d.ts","../../../node_modules/.pnpm/@sanity+comlink@4.0.3/node_modules/@sanity/comlink/dist/index.d.ts","../src/hooks/comlink/useFrameConnection.ts","../src/hooks/comlink/useWindowConnection.ts","../src/hooks/helpers/useNormalizedResourceOptions.ts","../src/hooks/comments/useCommentActions.ts","../src/hooks/comments/useComments.ts","../src/hooks/comments/useCommentThreads.ts","../src/hooks/context/useResource.ts","../src/hooks/context/useSanityInstance.ts","../src/hooks/dashboard/useFavoriteContext.ts","../src/hooks/dashboard/useFavorite.ts","../src/hooks/dashboard/useRecordDocumentHistoryEvent.ts","../src/hooks/dashboard/useStudioWorkspacesByProjectIdDataset.ts","../src/hooks/dashboard/useUpdateFavorite.ts","../src/hooks/datasets/useDatasets.ts","../src/hooks/document/useApplyDocumentActions.ts","../src/hooks/document/useCreateDocument.ts","../src/hooks/document/useDocument.ts","../src/hooks/document/useDocumentEvent.ts","../src/hooks/document/useDocumentPermissions.ts","../src/hooks/document/useDocumentSyncStatus.ts","../src/hooks/document/useEditDocument.ts","../src/hooks/documents/useDocuments.ts","../src/hooks/installations/useInstallation.ts","../src/hooks/installations/useInstallations.ts","../src/hooks/organizations/useOrganization.ts","../src/hooks/organizations/useOrganizations.ts","../src/hooks/paginatedDocuments/usePaginatedDocuments.ts","../src/hooks/presence/usePresence.ts","../src/hooks/presence/usePresenceForDocument.ts","../src/hooks/presence/useReportPresence.ts","../src/hooks/preview/useDocumentPreview.tsx","../src/hooks/projection/useDocumentProjection.ts","../src/hooks/projects/useProject.ts","../src/hooks/projects/useProjects.ts","../src/hooks/query/useQuery.ts","../src/hooks/releases/useActiveReleases.ts","../src/hooks/releases/useAllReleases.ts","../src/hooks/releases/useApplyReleaseActions.ts","../src/hooks/releases/usePerspective.ts","../src/hooks/users/useUser.ts","../src/hooks/users/useUsers.ts","../src/version.ts"],"x_google_ignoreList":[29,30],"mappings":";;;;;;;;;;;;;KAoBY,kBAAkB;;;;UCmBb;;;;;EAKf,iBAAiB,MAAM;IACrB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;EAOjB,oBAAoB,MAAM;IACxB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;;EAQjB,sBAAsB,MAAM,cAAc;;EAG1C,SAAS,MAAM;;;;EAKf;;EAGA,SAAS,MAAM;;EAGf,WAAW,MAAM;;;;;;;;EASjB;;;;;;;;;;;;;;;;;;;;;;;wBAwBc,eACd,wBACG,SACF,oBAAoB,MAAM;;;;;UCrGZ;;;;;;;EAOf,SAAS,eAAe;EACxB,YAAY,eAAe;EAC3B,UAAU,MAAM;EAEhB,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqFc,YACd,UACA,UACA,QAAQ,eACL,SACF,iBAAiB;;;;UC3HH,yBAAyB;EACxC,UAAU;EACV,QAAQ,eAAe;EACvB,UAAU;EACV,YAAY,eAAe;;EAE3B;;;;;;;wBAoBc,cACd,UACA,QACA,UACA,+BACG,SACF,mBAAmB;;;;;;;;;;;;UClCL,eACf,kCACA,4CACQ,cAAc,UAAU;;;;;EAKhC;;;;;;UAOe,mBACf,uCACA,kCACA,4CACQ,qBAAuB,eAAe,UAAU;EACxD;;;;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;;;;;;;;;;;;;;;;;;;;;;;;qBCblC,cACX,wCACA,wCAEA,UAAU,gBAAgB,gBAAgB,qBACvC,kBAAkB,QAAQ,gBAAgB;;;;;KC1B1C,gBACH,gCACA,kCACA,sCACE,wBAAwB,aAAa,QAAQ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0D3C,SACd,gCACA,kCACA,oCAEA,SAAS,gBAAgB,QAAQ,UAAU;;EAG3C,MAAM,mBAAmB,WAAW,cAAc;;EAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCc,SAAS,OAAO,SAAS,wBAAwB;;EAE/D,MAAM;;EAEN;;;;;;;;;;;;;;;;;;wBCzEc,kBACd,UAAU,wBAAwB,6BACjC;;;;;;;;;;;;;;;;;;;;;;;;;;wBCKa,eACd,UAAU,wBAAwB,6BACjC;;;;UClDO;OACH,QAAQ,gBAAgB,iBAAiB,UAAU,mBAAmB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsExE,wBAAwB;;;;;wBC1BrB,eAAe,oBAAoB;;;;;UC1ClC;;;;EAIf,MAAM;;;;EAIN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmCc,QAAQ,SAAS,iBAAiB;;;;;UCpCjC;;;;EAIf,MAAM;;;;EAIN;;;;EAKA;;;;EAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Dc,SAAS,UAAU,kBAAkB;;;;;qBCtFxC"}
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ function DashboardTokenRefresh(t0) {
|
|
|
37
37
|
if (clearRefreshTimeout(), res.token) {
|
|
38
38
|
setAuthToken(instance, res.token);
|
|
39
39
|
let errorContainer = document.getElementById("__sanityError");
|
|
40
|
-
errorContainer && Array.from(errorContainer.getElementsByTagName("div")).some(_temp$
|
|
40
|
+
errorContainer && Array.from(errorContainer.getElementsByTagName("div")).some(_temp$7) && errorContainer.remove();
|
|
41
41
|
}
|
|
42
42
|
isTokenRefreshInProgress.current = !1;
|
|
43
43
|
} catch {
|
|
@@ -62,7 +62,7 @@ function DashboardTokenRefresh(t0) {
|
|
|
62
62
|
* It is used to automatically request a new token on 401 error if enabled.
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
function _temp$
|
|
65
|
+
function _temp$7(div) {
|
|
66
66
|
return div.textContent?.includes("Uncaught error: Unauthorized - A valid session is required for this endpoint");
|
|
67
67
|
}
|
|
68
68
|
const ComlinkTokenRefreshProvider = (t0) => {
|
|
@@ -82,6 +82,37 @@ function useLoginUrl() {
|
|
|
82
82
|
let { subscribe, getCurrent } = t0;
|
|
83
83
|
return useSyncExternalStore(subscribe, getCurrent);
|
|
84
84
|
}
|
|
85
|
+
function createCallbackHook(callback) {
|
|
86
|
+
function useHook() {
|
|
87
|
+
let $ = c(2), instance = useSanityInstance(), t0;
|
|
88
|
+
return $[0] === instance ? t0 = $[1] : (t0 = (...t1) => callback(instance, ...t1), $[0] = instance, $[1] = t0), t0;
|
|
89
|
+
}
|
|
90
|
+
return useHook;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A React hook that returns a function for starting the OAuth authorization-code + PKCE flow.
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* The returned function invokes core's `startOAuthAuthorization`, which generates
|
|
97
|
+
* the PKCE `code_verifier`, `code_challenge` and `state`, persists the verifier and
|
|
98
|
+
* state to `sessionStorage`, and navigates the browser to the authorize endpoint.
|
|
99
|
+
* `clientId`, `redirectUri` and `organizationId` are read from the instance's
|
|
100
|
+
* `auth.oauth` config. The returned promise rejects if the instance has no `auth.oauth` config.
|
|
101
|
+
*
|
|
102
|
+
* Pair with {@link useHandleOAuthCallback} on the redirect URI to complete the flow.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* function LoginButton() {
|
|
107
|
+
* const authorize = useOAuthAuthorize()
|
|
108
|
+
* return <button onClick={() => authorize().catch(console.error)}>Sign in</button>
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @returns A function that starts the OAuth flow by navigating to the authorization URL
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
const useOAuthAuthorize = createCallbackHook(startOAuthAuthorization);
|
|
85
116
|
/**
|
|
86
117
|
* Hook that verifies the current projects belongs to the organization ID specified in the dashboard context.
|
|
87
118
|
*
|
|
@@ -264,11 +295,11 @@ function ChunkLoadError(_props) {
|
|
|
264
295
|
description: "The page tried to load an asset that no longer exists. Reload to continue with the latest version.",
|
|
265
296
|
cta: {
|
|
266
297
|
text: "Reload page",
|
|
267
|
-
onClick: _temp$
|
|
298
|
+
onClick: _temp$6
|
|
268
299
|
}
|
|
269
300
|
}), $[3] = t3) : t3 = $[3], t3;
|
|
270
301
|
}
|
|
271
|
-
function _temp$
|
|
302
|
+
function _temp$6() {
|
|
272
303
|
clearChunkReloadFlag(), reload();
|
|
273
304
|
}
|
|
274
305
|
function CorsErrorComponent(t0) {
|
|
@@ -325,13 +356,6 @@ var AuthError = class extends Error {
|
|
|
325
356
|
typeof error == "object" && error && "message" in error && typeof error.message == "string" ? super(error.message) : super(), this.cause = error;
|
|
326
357
|
}
|
|
327
358
|
};
|
|
328
|
-
function createCallbackHook(callback) {
|
|
329
|
-
function useHook() {
|
|
330
|
-
let $ = c(2), instance = useSanityInstance(), t0;
|
|
331
|
-
return $[0] === instance ? t0 = $[1] : (t0 = (...t1) => callback(instance, ...t1), $[0] = instance, $[1] = t0), t0;
|
|
332
|
-
}
|
|
333
|
-
return useHook;
|
|
334
|
-
}
|
|
335
359
|
/**
|
|
336
360
|
* @internal
|
|
337
361
|
* A React hook that returns a function for handling authentication callbacks.
|
|
@@ -373,10 +397,25 @@ function createCallbackHook(callback) {
|
|
|
373
397
|
* @public
|
|
374
398
|
*/
|
|
375
399
|
const useHandleAuthCallback = createCallbackHook(handleAuthCallback);
|
|
400
|
+
/** Every `key=value` in `subset` is present with the same value in `superset`. */
|
|
401
|
+
function isSubset(subset, superset) {
|
|
402
|
+
return [...subset].every(([key, value]) => superset.get(key) === value);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Whether `next` is `current` with callback params removed and nothing added.
|
|
406
|
+
* Core returns such a URL when there is nowhere else to go; anything additive
|
|
407
|
+
* (a path, query or hash the current URL lacks) is a destination to navigate to.
|
|
408
|
+
*/
|
|
409
|
+
function onlyStripsParams(next, current) {
|
|
410
|
+
return next.pathname === current.pathname && isSubset(next.searchParams, current.searchParams) && isSubset(new URLSearchParams(next.hash.slice(1)), new URLSearchParams(current.hash.slice(1)));
|
|
411
|
+
}
|
|
376
412
|
/**
|
|
377
413
|
* Component shown during auth callback processing that handles login completion.
|
|
378
414
|
* Automatically processes the auth callback when mounted and updates the URL
|
|
379
|
-
* to remove callback parameters without triggering a page reload.
|
|
415
|
+
* to remove callback parameters without triggering a page reload. When the
|
|
416
|
+
* callback resolves to a different location (the OAuth flow returns the user
|
|
417
|
+
* to where they started), a real navigation is performed instead so the app's
|
|
418
|
+
* router picks it up.
|
|
380
419
|
*
|
|
381
420
|
* @alpha
|
|
382
421
|
*/
|
|
@@ -384,12 +423,13 @@ function LoginCallback() {
|
|
|
384
423
|
let $ = c(3), handleAuthCallback = useHandleAuthCallback(), t0, t1;
|
|
385
424
|
return $[0] === handleAuthCallback ? (t0 = $[1], t1 = $[2]) : (t0 = () => {
|
|
386
425
|
let url = new URL(location.href);
|
|
387
|
-
handleAuthCallback(url.toString()).then(
|
|
426
|
+
handleAuthCallback(url.toString()).then((replacementLocation) => {
|
|
427
|
+
if (!replacementLocation) return;
|
|
428
|
+
let next = new URL(replacementLocation, url);
|
|
429
|
+
next.origin === url.origin && (onlyStripsParams(next, url) ? history.replaceState(null, "", replacementLocation) : location.replace(replacementLocation));
|
|
430
|
+
});
|
|
388
431
|
}, t1 = [handleAuthCallback], $[0] = handleAuthCallback, $[1] = t0, $[2] = t1), useEffect(t0, t1), null;
|
|
389
432
|
}
|
|
390
|
-
function _temp$6(replacementLocation) {
|
|
391
|
-
replacementLocation && history.replaceState(null, "", replacementLocation);
|
|
392
|
-
}
|
|
393
433
|
/**
|
|
394
434
|
* Hook to log out of the current session
|
|
395
435
|
* @internal
|
|
@@ -535,23 +575,26 @@ function AuthBoundary(t0) {
|
|
|
535
575
|
}) }) }), $[9] = FallbackComponent, $[10] = t3, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
|
|
536
576
|
}
|
|
537
577
|
function AuthSwitch(t0) {
|
|
538
|
-
let $ = c(
|
|
578
|
+
let $ = c(18), children, projectIds, props, t1, t2;
|
|
539
579
|
$[0] === t0 ? (children = $[1], projectIds = $[2], props = $[3], t1 = $[4], t2 = $[5]) : ({CallbackComponent: t1, children, verifyOrganization: t2, projectIds, ...props} = t0, $[0] = t0, $[1] = children, $[2] = projectIds, $[3] = props, $[4] = t1, $[5] = t2);
|
|
540
580
|
let CallbackComponent = t1 === void 0 ? LoginCallback : t1, verifyOrganization = t2 === void 0 || t2, authState = useAuthState(), instance = useSanityInstance(), t3;
|
|
541
581
|
$[6] === instance.config ? t3 = $[7] : (t3 = isStudioConfig(instance.config), $[6] = instance.config, $[7] = t3);
|
|
542
|
-
let isStudio = t3, orgError = useVerifyOrgProjects(!verifyOrganization || isStudio || authState.type !== AuthStateType.LOGGED_IN, projectIds), isLoggedOut = authState.type === AuthStateType.LOGGED_OUT && !authState.isDestroyingSession, loginUrl = useLoginUrl(), t4, t5;
|
|
543
|
-
if ($[8] !==
|
|
544
|
-
isLoggedOut && !isInIframe() && !isStudio && !isDashboardEnvironment() && (window.location.href = loginUrl);
|
|
582
|
+
let isStudio = t3, orgError = useVerifyOrgProjects(!verifyOrganization || isStudio || authState.type !== AuthStateType.LOGGED_IN, projectIds), isLoggedOut = authState.type === AuthStateType.LOGGED_OUT && !authState.isDestroyingSession, isOAuth = !!instance.config.auth?.oauth, loginUrl = useLoginUrl(), authorize = useOAuthAuthorize(), [authorizeError, setAuthorizeError] = useState(null), t4, t5;
|
|
583
|
+
if ($[8] !== authorize || $[9] !== isLoggedOut || $[10] !== isOAuth || $[11] !== isStudio || $[12] !== loginUrl ? (t4 = () => {
|
|
584
|
+
isLoggedOut && !isInIframe() && !isStudio && !isDashboardEnvironment() && (isOAuth ? authorize().catch((error) => setAuthorizeError({ error })) : window.location.href = loginUrl);
|
|
545
585
|
}, t5 = [
|
|
546
586
|
isLoggedOut,
|
|
587
|
+
isOAuth,
|
|
588
|
+
authorize,
|
|
547
589
|
loginUrl,
|
|
548
590
|
isStudio
|
|
549
|
-
], $[8] =
|
|
591
|
+
], $[8] = authorize, $[9] = isLoggedOut, $[10] = isOAuth, $[11] = isStudio, $[12] = loginUrl, $[13] = t4, $[14] = t5) : (t4 = $[13], t5 = $[14]), useEffect(t4, t5), verifyOrganization && orgError) throw new ConfigurationError({ message: orgError });
|
|
592
|
+
if (authorizeError) throw new AuthError(authorizeError.error);
|
|
550
593
|
switch (authState.type) {
|
|
551
594
|
case AuthStateType.ERROR: throw new AuthError(authState.error);
|
|
552
595
|
case AuthStateType.LOGGING_IN: {
|
|
553
596
|
let t6;
|
|
554
|
-
return $[
|
|
597
|
+
return $[15] !== CallbackComponent || $[16] !== props ? (t6 = /* @__PURE__ */ jsx(CallbackComponent, { ...props }), $[15] = CallbackComponent, $[16] = props, $[17] = t6) : t6 = $[17], t6;
|
|
555
598
|
}
|
|
556
599
|
case AuthStateType.LOGGED_IN: return children;
|
|
557
600
|
case AuthStateType.LOGGED_OUT: return null;
|
|
@@ -1753,7 +1796,7 @@ function createMutationHook(mutation) {
|
|
|
1753
1796
|
* @internal
|
|
1754
1797
|
* @returns The mutation envelope `{mutate, isPending, error, data, reset}`.
|
|
1755
1798
|
*/
|
|
1756
|
-
const useDeleteApplication = createMutationHook(deleteApplication), useUpdateApplication = createMutationHook(updateApplication), useAuthToken = createStateSourceHook(getTokenState), useCurrentUser = createStateSourceHook(getCurrentUserState), useHandleOAuthCallback = createCallbackHook(handleOAuthCallback),
|
|
1799
|
+
const useDeleteApplication = createMutationHook(deleteApplication), useUpdateApplication = createMutationHook(updateApplication), useAuthToken = createStateSourceHook(getTokenState), useCurrentUser = createStateSourceHook(getCurrentUserState), useHandleOAuthCallback = createCallbackHook(handleOAuthCallback), useOAuthTokensState = createStateSourceHook(getOAuthTokensState), useRefreshOAuthTokens = createCallbackHook(refreshOAuthTokens), useRevokeOAuthTokens = createCallbackHook(revokeOAuthTokens), useIsOAuthTokenExpired = createCallbackHook((instance) => {
|
|
1757
1800
|
let tokens = getOAuthTokensState(instance).getCurrent();
|
|
1758
1801
|
return tokens ? tokens.expiresAt.getTime() <= Date.now() : !1;
|
|
1759
1802
|
});
|
|
@@ -4129,7 +4172,7 @@ function useUsers(options) {
|
|
|
4129
4172
|
loadMore
|
|
4130
4173
|
}, $[20] = data, $[21] = hasMore, $[22] = isPending, $[23] = loadMore, $[24] = t8) : t8 = $[24], t8;
|
|
4131
4174
|
}
|
|
4132
|
-
var version = "3.5.0-next.
|
|
4175
|
+
var version = "3.5.0-next.20260922191653";
|
|
4133
4176
|
function getEnv(key) {
|
|
4134
4177
|
if (import.meta.env) return import.meta.env[key];
|
|
4135
4178
|
if (typeof process < "u" && process.env) return process.env[key];
|