diff --git a/src/services/kdbInsights/codeFlowLogin.ts b/src/services/kdbInsights/codeFlowLogin.ts index 1ddb8d4b..d0bb688e 100644 --- a/src/services/kdbInsights/codeFlowLogin.ts +++ b/src/services/kdbInsights/codeFlowLogin.ts @@ -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()); } diff --git a/test/suite/services.test.ts b/test/suite/services.test.ts index 4245bf97..b1c31e5b 100644 --- a/test/suite/services.test.ts +++ b/test/suite/services.test.ts @@ -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")); });