fix: append auth token to url

This commit is contained in:
Derrick Hammer 2024-02-13 00:01:34 -05:00
parent 10e41875e6
commit 8e172ebef9
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import { CustomClientOptions, optionsToConfig } from "../utils/options.js";
import path from "path"; import path from "path";
import { DEFAULT_UPLOAD_OPTIONS } from "#methods/upload.js"; import { DEFAULT_UPLOAD_OPTIONS } from "#methods/upload.js";
import { getS5DownloadCid, getS5MetadataCid } from "#generated/index.js"; import { getS5DownloadCid, getS5MetadataCid } from "#generated/index.js";
import { addUrlQuery } from "#utils/url.js";
/** /**
* Custom download options. * Custom download options.
@ -81,7 +82,10 @@ export async function getCidUrl(
cid: string, cid: string,
customOptions: CustomDownloadOptions = {}, customOptions: CustomDownloadOptions = {},
): Promise<string> { ): Promise<string> {
return path.join(this.portalUrl, cid); const opt = { ...this.customOptions, customOptions };
return addUrlQuery(path.join(this.portalUrl, cid), {
auth_token: opt.ApiKey,
});
} }
/** /**