Skip to content

Commit cee4a1e

Browse files
authored
Don't prompt for Server Manager credentials when using minimal security (#1351)
1 parent d144665 commit cee4a1e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/extension.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,15 @@ export async function resolveConnectionSpec(serverName: string): Promise<void> {
223223
export async function resolvePassword(serverSpec): Promise<void> {
224224
const AUTHENTICATION_PROVIDER = "intersystems-server-credentials";
225225
// This arises if setting says to use authentication provider
226-
if (typeof serverSpec.password === "undefined") {
227-
const scopes = [serverSpec.name, serverSpec.username || ""];
226+
if (
227+
// Connection isn't unauthenticated
228+
serverSpec.username != undefined &&
229+
serverSpec.username != "" &&
230+
serverSpec.username.toLowerCase() != "unknownuser" &&
231+
// A password is missing
232+
typeof serverSpec.password == "undefined"
233+
) {
234+
const scopes = [serverSpec.name, serverSpec.username];
228235
let session = await vscode.authentication.getSession(AUTHENTICATION_PROVIDER, scopes, { silent: true });
229236
if (!session) {
230237
session = await vscode.authentication.getSession(AUTHENTICATION_PROVIDER, scopes, { createIfNone: true });

0 commit comments

Comments
 (0)