@@ -24,6 +24,7 @@ import {
24
24
isSsoConnection ,
25
25
isBuilderIdConnection ,
26
26
} from '../../auth/connection'
27
+ import { getLogger } from '../../shared/logger'
27
28
28
29
export const defaultCwScopes = [ ...ssoAccountAccessScopes , ...codewhispererScopes ]
29
30
export const awsBuilderIdSsoProfile = createBuilderIdProfile ( defaultCwScopes )
@@ -181,15 +182,27 @@ export class AuthUtil {
181
182
}
182
183
183
184
public isConnectionValid ( ) : boolean {
184
- return this . conn !== undefined && ! this . secondaryAuth . isConnectionExpired
185
+ const connectionValid = this . conn !== undefined && ! this . secondaryAuth . isConnectionExpired
186
+ getLogger ( ) . debug ( `codewhisperer: Connection is valid = ${ connectionValid } ,
187
+ connection is undefined = ${ this . conn === undefined } ,
188
+ secondaryAuth connection expired = ${ this . secondaryAuth . isConnectionExpired } ` )
189
+ return connectionValid
185
190
}
186
191
187
192
public isConnectionExpired ( ) : boolean {
188
- return (
193
+ const connectionExpired =
189
194
this . secondaryAuth . isConnectionExpired &&
190
195
this . conn !== undefined &&
191
196
isValidCodeWhispererConnection ( this . conn )
192
- )
197
+ getLogger ( ) . debug ( `codewhisperer: Connection expired = ${ connectionExpired } ,
198
+ secondaryAuth connection expired = ${ this . secondaryAuth . isConnectionExpired } ,
199
+ connection is undefined = ${ this . conn === undefined } ` )
200
+ if ( this . conn ) {
201
+ getLogger ( ) . debug (
202
+ `codewhisperer: isValidCodeWhispererConnection = ${ isValidCodeWhispererConnection ( this . conn ) } `
203
+ )
204
+ }
205
+ return connectionExpired
193
206
}
194
207
195
208
public async reauthenticate ( ) {
0 commit comments