diff --git a/packages/hub/src/lib/file-download-info.ts b/packages/hub/src/lib/file-download-info.ts index 210bd11e7..3dcc79ee9 100644 --- a/packages/hub/src/lib/file-download-info.ts +++ b/packages/hub/src/lib/file-download-info.ts @@ -50,7 +50,7 @@ export async function fileDownloadInfo( const resp = await (params.fetch ?? fetch)(url, { method: "GET", headers: { - ...(params.credentials && { + ...(accessToken && { Authorization: `Bearer ${accessToken}`, }), Range: "bytes=0-0", diff --git a/packages/hub/src/lib/list-models.ts b/packages/hub/src/lib/list-models.ts index 0e62c8caf..db241c458 100644 --- a/packages/hub/src/lib/list-models.ts +++ b/packages/hub/src/lib/list-models.ts @@ -94,7 +94,7 @@ export async function* listModels< const res: Response = await (params?.fetch ?? fetch)(url, { headers: { accept: "application/json", - ...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined), + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), }, }); diff --git a/packages/hub/src/lib/list-spaces.ts b/packages/hub/src/lib/list-spaces.ts index 36a251afd..a14e7e301 100644 --- a/packages/hub/src/lib/list-spaces.ts +++ b/packages/hub/src/lib/list-spaces.ts @@ -82,7 +82,7 @@ export async function* listSpaces< const res: Response = await (params?.fetch ?? fetch)(url, { headers: { accept: "application/json", - ...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined), + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), }, }); diff --git a/packages/hub/src/lib/paths-info.ts b/packages/hub/src/lib/paths-info.ts index c706768f1..ec455f882 100644 --- a/packages/hub/src/lib/paths-info.ts +++ b/packages/hub/src/lib/paths-info.ts @@ -86,7 +86,7 @@ export async function pathsInfo( const resp = await (params.fetch ?? fetch)(url, { method: "POST", headers: { - ...(params.credentials && { + ...(accessToken && { Authorization: `Bearer ${accessToken}`, }), Accept: "application/json",