Fix issues with axios update

This commit is contained in:
Bill Thornton 2021-10-07 09:39:43 -04:00
parent f4ecc5546a
commit 0c7218fca9
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ describe('Api', () => {
const requestData = mockAxios.request.mock.calls[0][0];
expect(requestData.url).toBe(`${SERVER_URL}/Users/AuthenticateByName`);
expect(requestData.headers[AUTHORIZATION_HEADER]).toBe(getAuthorizationHeader(TEST_CLIENT, TEST_DEVICE));
expect(requestData.headers?.[AUTHORIZATION_HEADER]).toBe(getAuthorizationHeader(TEST_CLIENT, TEST_DEVICE));
expect(requestData.data).toBe(JSON.stringify(USER_CREDENTIALS));
expect(api.accessToken).toBe(TEST_ACCESS_TOKEN);

View File

@ -61,7 +61,7 @@ export class Api {
/**
* Convenience method for logging out and updating the internal state.
*/
logout(): Promise<AxiosResponse> {
logout(): Promise<AxiosResponse<never> | AxiosResponse<void>> {
return this.sessionApi.reportSessionEnded().then(response => {
this.accessToken = '';
return response;