Skip to content

Commit

Permalink
chore(templates): remove auth token download flow (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Feb 21, 2024
1 parent 796a4ca commit 21b16c3
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
});
}

Expand Down

0 comments on commit 21b16c3

Please sign in to comment.