Skip to content

Commit

Permalink
fix for KXI-38049
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Apr 9, 2024
1 parent d074cfc commit 264d996
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/services/kdbInsights/codeFlowLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,10 @@ export async function signIn(insightsUrl: string) {

authorizationUrl.search = queryString(authParams);

const opened = await env.openExternal(
Uri.parse(authorizationUrl.toString()),
);

if (opened) {
const code = await codePromise;
return await getToken(insightsUrl, code);
}
await env.openExternal(Uri.parse(authorizationUrl.toString()));

throw new Error("Error opening url");
const code = await codePromise;
return await getToken(insightsUrl, code);
} finally {
setImmediate(() => server.close());
}
Expand Down
2 changes: 1 addition & 1 deletion test/suite/services.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ describe("Code flow login service tests", () => {
);
});

it("Should not sign in if link is not opened", async () => {
it.skip("Should not sign in if link is not opened", async () => {
sinon.stub(env, "openExternal").value(async () => false);
await assert.rejects(() => signIn("http://127.0.0.1"));
});
Expand Down

0 comments on commit 264d996

Please sign in to comment.