Skip to content

Commit d462217

Browse files
authored
Merge pull request #9 from headlamp-k8s/backend-token
app-catalog: Add the backend token to more helm-related requests
2 parents 3e1485a + c094267 commit d462217

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app-catalog/src/api/releases.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ApiProxy } from '@kinvolk/headlamp-plugin/lib';
22

33
const request = ApiProxy.request;
4-
const getHeadlampAPIHeaders = () => ({
4+
export const getHeadlampAPIHeaders = () => ({
55
'X-HEADLAMP_BACKEND-TOKEN': new URLSearchParams(window.location.search).get('backendToken'),
66
});
77

app-catalog/src/api/repository.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ApiProxy } from '@kinvolk/headlamp-plugin/lib';
2+
import { getHeadlampAPIHeaders } from './releases';
23

34
const request = ApiProxy.request;
45

@@ -9,5 +10,6 @@ export function addRepository(repoName: string, repoURL: string) {
910
name: repoName,
1011
url: repoURL,
1112
}),
13+
headers: { ...getHeadlampAPIHeaders() },
1214
});
1315
}

0 commit comments

Comments
 (0)