fix(ui): assist cred call with header

This commit is contained in:
Shekar Siri 2024-11-06 18:19:37 +01:00
parent baebdcd8d2
commit b83d8db2a9
2 changed files with 6 additions and 2 deletions

View file

@ -58,13 +58,17 @@ export default class APIClient {
private onUpdateJwt: (data: { jwt?: string, spotJwt?: string }) => void; private onUpdateJwt: (data: { jwt?: string, spotJwt?: string }) => void;
private refreshingTokenPromise: Promise<string> | null = null; private refreshingTokenPromise: Promise<string> | null = null;
constructor() { constructor(jwt?: string | null) {
this.init = { this.init = {
headers: new Headers({ headers: new Headers({
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}) })
}; };
if (jwt) {
this.setJwt(jwt);
}
} }
setJwt(jwt: string | null): void { setJwt(jwt: string | null): void {

View file

@ -55,7 +55,7 @@ function LivePlayer({
}, },
}; };
if (isEnterprise) { if (isEnterprise) {
new APIClient() new APIClient(userStore.jwt)
.get('/config/assist/credentials') .get('/config/assist/credentials')
.then((r) => r.json()) .then((r) => r.json())
.then(({ data }) => { .then(({ data }) => {