Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions libs/vscode-extension/src/lib/services/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class HttpClient implements IHttpClient {
headers: {
...this._extraHeaders,
...options.headers,
Authorization: `${isArmId ? this._accessToken : ''}`,
Authorization: isArmId ? (this._accessToken ?? '') : '',
},
};
const response = await axios({
Expand All @@ -58,7 +58,7 @@ export class HttpClient implements IHttpClient {
headers: {
...this._extraHeaders,
...options.headers,
Authorization: `${isArmId ? this._accessToken : ''}`,
Authorization: isArmId ? (this._accessToken ?? '') : '',
'Content-Type': 'application/json',
},
data: options.content,
Expand All @@ -77,7 +77,7 @@ export class HttpClient implements IHttpClient {
}

async post<ReturnType, BodyType>(options: HttpRequestOptions<BodyType>): Promise<ReturnType> {
const authHeader: Record<string, string> = options.includeAuth || !options.noAuth ? { Authorization: `${this._accessToken}` } : {};
const authHeader: Record<string, string> = options.includeAuth || !options.noAuth ? { Authorization: this._accessToken ?? '' } : {};
const request = {
...options,
url: this.getRequestUrl(options),
Expand Down Expand Up @@ -115,7 +115,7 @@ export class HttpClient implements IHttpClient {
headers: {
...this._extraHeaders,
...options.headers,
Authorization: `${isArmId ? this._accessToken : ''}`,
Authorization: isArmId ? (this._accessToken ?? '') : '',
'Content-Type': 'application/json',
},
data: options.content,
Expand Down Expand Up @@ -144,7 +144,7 @@ export class HttpClient implements IHttpClient {
headers: {
...this._extraHeaders,
...options.headers,
Authorization: `${this._accessToken}`,
Authorization: this._accessToken ?? '',
},
};
const response = await axios({
Expand Down