diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 48ae5af0eb..693a361fc8 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -23,6 +23,7 @@ interface AuthConfig { type: AuthType config: BasicAuthConfig | BearerAuthConfig } + interface BasicAuthConfig { username: string, password: string, @@ -170,7 +171,7 @@ module RestModule { } processAuth(authConfigId: string) { - if (!this.config.authConfigs) { + if (!this.config.authConfigs || !authConfigId) { return } const authConfig = this.config.authConfigs.filter(authConfig => authConfig.id === authConfigId)[0] diff --git a/packages/server/src/integrations/tests/rest.spec.js b/packages/server/src/integrations/tests/rest.spec.js index 610054ccfc..74e81448ba 100644 --- a/packages/server/src/integrations/tests/rest.spec.js +++ b/packages/server/src/integrations/tests/rest.spec.js @@ -27,10 +27,6 @@ describe("REST Integration", () => { }) }) - // afterEach(() => { - // jest.clearAllMocks() - // }) - it("calls the create method with the correct params", async () => { const query = { path: "api",