diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/ApolloExplorerBrowser.tsx b/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/ApolloExplorerBrowser.tsx index e50b4847a2..d0c90708a1 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/ApolloExplorerBrowser.tsx +++ b/plugins/apollo-explorer/src/components/ApolloExplorerBrowser/ApolloExplorerBrowser.tsx @@ -57,7 +57,7 @@ export type ApolloEndpointProps = { type Props = { endpoints: ApolloEndpointProps[]; - authCallback?: () => Promise; + authCallback?: () => Promise<{ token: string }>; }; export const handleAuthRequest = ({ @@ -71,7 +71,7 @@ export const handleAuthRequest = ({ headers: { ...options.headers, ...(authCallback && { - Authorization: `Bearer ${await authCallback()}`, + Authorization: `Bearer ${(await authCallback()).token}`, }), }, }); diff --git a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx index fbbced24d1..b9d25a1a06 100644 --- a/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx +++ b/plugins/apollo-explorer/src/components/ApolloExplorerPage/ApolloExplorerPage.tsx @@ -48,7 +48,7 @@ export type EndpointProps = { */ export type AuthCallback = (options: { apiHolder: ApiHolder; -}) => Promise; +}) => Promise<{ token: string }>; type Props = { title?: string | undefined;