From 2f4ba4bf41f97594ac18abecd6771a31a5f8d9cd Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Thu, 23 Mar 2023 10:23:56 -0800 Subject: [PATCH] restore authURL --- frontend/lib/api/base/base-api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/lib/api/base/base-api.ts b/frontend/lib/api/base/base-api.ts index 13b4269..3847a4b 100644 --- a/frontend/lib/api/base/base-api.ts +++ b/frontend/lib/api/base/base-api.ts @@ -70,6 +70,16 @@ export class BaseAPI { this.attachmentToken = attachmentToken; } + // if a attachmentToken is present it will be added to URL as a query param + // this is done with a simple appending of the query param to the URL. If your + // URL already has a query param, this will not work. + authURL(url: string): string { + if (this.attachmentToken) { + return `/api/v1${url}?access_token=${this.attachmentToken}`; + } + return url; + } + /** * dropFields will remove any fields that are specified in the fields array * additionally, it will remove the `createdAt` and `updatedAt` fields if they