Skip to content

Commit

Permalink
Improve fix for #300
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed Jan 17, 2024
1 parent 1cc44e0 commit 20149fd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,13 @@ export async function activate(context: ExtensionContext) {
// Register custom request handlers
client.onRequest("intersystems/server/resolveFromUri", async (uri: string) => {
let serverSpec = objectScriptApi.serverForUri(Uri.parse(uri));
if (serverSpec.username.toLowerCase() == "unknownuser" && typeof serverSpec.password === "undefined") {
// UnknownUser without a password means "unauthenticated"
serverSpec.username = undefined;
}
if (
// Server was resolved
serverSpec.host !== "" &&
// Connection isn't unauthenticated
serverSpec.username != undefined &&
serverSpec.username != "" &&
serverSpec.username.toLowerCase() != "unknownuser" &&
// A password is missing
typeof serverSpec.password === "undefined" &&
// A supported version of the Server Manager is installed
Expand All @@ -177,6 +174,10 @@ export async function activate(context: ExtensionContext) {
}
}
}
if (serverSpec.username.toLowerCase() == "unknownuser" && typeof serverSpec.password === "undefined") {
// UnknownUser without a password means "unauthenticated"
serverSpec.username = undefined;
}
return serverSpec;
}),
client.onRequest("intersystems/uri/localToVirtual", (uri: string): string => {
Expand Down

0 comments on commit 20149fd

Please sign in to comment.