Skip to content

Commit 2b4643f

Browse files
authored
use accessToken in listDatasets (#1064)
fix #1063
1 parent 5a83944 commit 2b4643f

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/hub/src/lib/file-download-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function fileDownloadInfo(
5050
const resp = await (params.fetch ?? fetch)(url, {
5151
method: "GET",
5252
headers: {
53-
...(params.credentials && {
53+
...(accessToken && {
5454
Authorization: `Bearer ${accessToken}`,
5555
}),
5656
Range: "bytes=0-0",

packages/hub/src/lib/list-datasets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export async function* listDatasets<
8686
const res: Response = await (params?.fetch ?? fetch)(url, {
8787
headers: {
8888
accept: "application/json",
89-
...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined),
89+
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined),
9090
},
9191
});
9292

packages/hub/src/lib/list-models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function* listModels<
9494
const res: Response = await (params?.fetch ?? fetch)(url, {
9595
headers: {
9696
accept: "application/json",
97-
...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined),
97+
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined),
9898
},
9999
});
100100

packages/hub/src/lib/list-spaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function* listSpaces<
8282
const res: Response = await (params?.fetch ?? fetch)(url, {
8383
headers: {
8484
accept: "application/json",
85-
...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined),
85+
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined),
8686
},
8787
});
8888

packages/hub/src/lib/paths-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export async function pathsInfo(
8686
const resp = await (params.fetch ?? fetch)(url, {
8787
method: "POST",
8888
headers: {
89-
...(params.credentials && {
89+
...(accessToken && {
9090
Authorization: `Bearer ${accessToken}`,
9191
}),
9292
Accept: "application/json",

0 commit comments

Comments
 (0)