You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vscode.window.showErrorMessage(`Anonymous access rejected by ${connInfo}.`);
348
-
if(!api.externalServer){
349
-
vscode.window.showErrorMessage("Connection has been disabled.");
350
-
disableConnection(configName);
351
-
}
352
-
}else{
353
-
InputBoxManager.showInputBox(
354
-
{
354
+
letsuccess=false;
355
+
message="Not Authorized.";
356
+
errorMessage=`Authorization error: Check your credentials in Settings, and that you have sufficient privileges on the /api/atelier web application on ${connInfo}`;
357
+
constusername=api.config.username;
358
+
if(username===""){
359
+
vscode.window.showErrorMessage(`Anonymous access rejected by ${connInfo}.`);
360
+
if(!api.externalServer){
361
+
vscode.window.showErrorMessage("Connection has been disabled.");
362
+
awaitsetConnectionState(configName,false);
363
+
}
364
+
}else{
365
+
success=awaitnewPromise<boolean>((resolve)=>{
366
+
vscode.window
367
+
.showInputBox({
355
368
password: true,
356
369
placeHolder: `Not Authorized. Enter password to connect as user '${username}' to ${connInfo}`,
357
370
prompt: !api.externalServer ? "If no password is entered the connection will be disabled." : "",
console.log(`Finished prompting for password, got ${workspaceState.get(configName+":password")}`);
399
+
resolve(false);
400
+
},
401
+
(reason)=>{
402
+
console.log(`showInputBox for password dismissed: ${reason}`);
367
403
}
368
-
},
369
-
connInfo
370
-
);
404
+
);
405
+
});
406
+
if(success){
407
+
return;
371
408
}
372
-
},1000);
373
-
message="Not Authorized.";
374
-
errorMessage=`Authorization error: Check your credentials in Settings, and that you have sufficient privileges on the /api/atelier web application on ${connInfo}`;
409
+
}
375
410
}else{
376
411
errorMessage=`${message}\nCheck your server details in Settings (${connInfo}).`;
377
412
}
@@ -395,16 +430,16 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
395
430
});
396
431
}
397
432
398
-
// Set objectscript.conn.active = false at WorkspaceFolder level if objectscript.conn is defined there,
399
-
// else set it false at Workspace level
400
-
functiondisableConnection(configName: string){
433
+
// Set objectscript.conn.active at WorkspaceFolder level if objectscript.conn is defined there,
0 commit comments