@@ -208,7 +208,7 @@ export let checkingConnection = false;
208208export let serverManagerApi : serverManager . ServerManagerAPI ;
209209
210210/** Map of the intersystems.server connection specs we have resolved via the API to that extension */
211- const resolvedConnSpecs = new Map < string , serverManager . IServerSpec & { accessToken ?: string } > ( ) ;
211+ const resolvedConnSpecs = new Map < string , serverManager . IServerSpec > ( ) ;
212212
213213/**
214214 * If servermanager extension is available, fetch the connection spec unless already cached.
@@ -267,10 +267,10 @@ export async function resolveConnectionSpec(
267267}
268268
269269async function resolvePassword (
270- serverSpec : Pick < serverManager . IServerSpec , "name" | "auth" > ,
270+ serverSpec : serverManager . IServerSpec ,
271271 ignoreUnauthenticated = false
272272) : Promise < string | undefined > {
273- if ( ! ( ( serverSpec . auth . resolved ( ) as boolean ) || ignoreUnauthenticated ) ) {
273+ if ( ! ( serverSpec . auth . resolved ( ) as boolean ) || ignoreUnauthenticated ) {
274274 const scopes = [ serverSpec . name , serverSpec . auth ?. username || "" ] ;
275275
276276 // Handle Server Manager extension version < 3.8.0
@@ -304,15 +304,14 @@ export async function resolveUsernameAndPassword(
304304) : Promise < ( serverManager . IServerSpec & { accessToken ?: string } ) | undefined > {
305305 const { auth : _auth , ...newSpec } = oldSpec ;
306306 newSpec . name = serverName ;
307- const auth = _auth . clone ( ) ;
307+ const auth = _auth ? .clone ( ) ;
308308
309309 const accessToken = await resolvePassword ( { ...newSpec , auth } , true ) ;
310- if ( auth . resolved ( ) ) {
310+ if ( auth . resolve ( { accessToken } ) ) {
311311 // Update the connection spec
312312 resolvedConnSpecs . set ( serverName , {
313313 ...oldSpec ,
314314 auth,
315- accessToken,
316315 } ) ;
317316 return resolvedConnSpecs . get ( serverName ) ;
318317 }
@@ -365,7 +364,7 @@ export async function checkConnection(
365364 _onDidChangeConnection . fire ( ) ;
366365 }
367366 let api = new AtelierAPI ( apiTarget , false ) ;
368- const { active, host = "" , port = 0 , superserverPort = 0 , ns = "" , auth : authorization } = api . config ;
367+ const { active, host = "" , port = 0 , superserverPort = 0 , ns = "" , auth } = api . config ;
369368 vscode . commands . executeCommand ( "setContext" , "vscode-objectscript.connectActive" , active ) ;
370369 if ( ! panel . text ) {
371370 panel . text = `${ PANEL_LABEL } ` ;
@@ -451,10 +450,10 @@ export async function checkConnection(
451450 const { serverName, host, port, pathPrefix } = api . config ;
452451 if ( serverName ) {
453452 panel . tooltip = new vscode . MarkdownString (
454- `Connected to \`${ host } :${ port } ${ pathPrefix } \` as \`${ authorization . username } \``
453+ `Connected to \`${ host } :${ port } ${ pathPrefix } \` as \`${ auth . username } \``
455454 ) ;
456455 } else {
457- panel . tooltip = new vscode . MarkdownString ( `Connected as \`${ authorization . username } \`` ) ;
456+ panel . tooltip = new vscode . MarkdownString ( `Connected as \`${ auth . username } \`` ) ;
458457 }
459458 inactiveServerIds . delete ( api . serverId ) ;
460459 if ( ! api . externalServer ) await setConnectionState ( configName , true ) ;
0 commit comments