diff --git a/src/auth/AuthManager.ts b/src/auth/AuthManager.ts index 4ed4171..a11573d 100644 --- a/src/auth/AuthManager.ts +++ b/src/auth/AuthManager.ts @@ -102,7 +102,7 @@ export class AuthManager { this.logOut() const { result: formResponse } = await this.requestClient.get( - this.loginUrl.replace('do', ''), + this.loginUrl.replace('.do', ''), undefined, 'text/plain' ) diff --git a/src/auth/spec/AuthManager.spec.ts b/src/auth/spec/AuthManager.spec.ts index ce4a5d1..5d9e387 100644 --- a/src/auth/spec/AuthManager.spec.ts +++ b/src/auth/spec/AuthManager.spec.ts @@ -176,15 +176,19 @@ describe('AuthManager', () => { const response = await authManager.checkSession() expect(response.isLoggedIn).toBeTruthy() - expect(mockedAxios.get).toHaveBeenNthCalledWith(1, `http://test-server.com/SASJobExecution`, { - withCredentials: true, - responseType: 'text', - transformResponse: undefined, - headers: { - Accept: '*/*', - 'Content-Type': 'text/plain' + expect(mockedAxios.get).toHaveBeenNthCalledWith( + 1, + `http://test-server.com/SASJobExecution`, + { + withCredentials: true, + responseType: 'text', + transformResponse: undefined, + headers: { + Accept: '*/*', + 'Content-Type': 'text/plain' + } } - }) + ) done() })