From 21b16c3eaf2a420453988d30a6adb6d1b9405502 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Wed, 21 Feb 2024 14:45:49 -0500 Subject: [PATCH] chore(templates): remove auth token download flow (#1215) --- src/app/Shared/Services/Api.service.tsx | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/app/Shared/Services/Api.service.tsx b/src/app/Shared/Services/Api.service.tsx index 8a595851b..0583bb946 100644 --- a/src/app/Shared/Services/Api.service.tsx +++ b/src/app/Shared/Services/Api.service.tsx @@ -791,24 +791,12 @@ export class ApiService { map( (target) => `${this.login.authority}/api/v2.1/targets/${encodeURIComponent( - target?.connectUrl || '', + target!.connectUrl, )}/templates/${encodeURIComponent(template.name)}/type/${encodeURIComponent(template.type)}`, ), ) - .subscribe((resource) => { - const body = new window.FormData(); - body.append('resource', resource); - this.sendRequest('v2.1', 'auth/token', { - method: 'POST', - body, - }) - .pipe( - concatMap((resp) => resp.json()), - map((response: AssetJwtResponse) => response.data.result.resourceUrl), - ) - .subscribe((resourceUrl) => { - this.downloadFile(resourceUrl, `${template.name}.jfc`); - }); + .subscribe((resourceUrl) => { + this.downloadFile(resourceUrl, `${template.name}.jfc`); }); }