@@ -45,7 +45,6 @@ export const isValidCodeWhispererConnection = (conn?: Connection): conn is Conne
45
45
export class AuthUtil {
46
46
static #instance: AuthUtil
47
47
48
- private usingEnterpriseSSO : boolean = false
49
48
private reauthenticatePromptShown : boolean = false
50
49
private _isCustomizationFeatureEnabled : boolean = false
51
50
@@ -79,14 +78,9 @@ export class AuthUtil {
79
78
}
80
79
} )
81
80
82
- this . secondaryAuth . onDidChangeActiveConnection ( async conn => {
83
- if ( conn ?. type === 'sso' ) {
84
- this . usingEnterpriseSSO = ! isBuilderIdConnection ( conn )
85
- if ( ! this . isConnectionExpired ( ) && this . usingEnterpriseSSO ) {
86
- vscode . commands . executeCommand ( 'aws.codeWhisperer.notifyNewCustomizations' )
87
- }
88
- } else {
89
- this . usingEnterpriseSSO = false
81
+ this . secondaryAuth . onDidChangeActiveConnection ( async ( ) => {
82
+ if ( this . isValidEnterpriseSsoInUse ( ) ) {
83
+ vscode . commands . executeCommand ( 'aws.codeWhisperer.notifyNewCustomizations' )
90
84
}
91
85
await Promise . all ( [
92
86
vscode . commands . executeCommand ( 'aws.codeWhisperer.refresh' ) ,
@@ -134,7 +128,10 @@ export class AuthUtil {
134
128
}
135
129
136
130
public isEnterpriseSsoInUse ( ) : boolean {
137
- return this . conn !== undefined && this . usingEnterpriseSSO
131
+ const conn = this . conn
132
+ // we have an sso that isn't builder id, must be IdC by process of elimination
133
+ const isUsingEnterpriseSso = conn ?. type === 'sso' && ! isBuilderIdConnection ( conn )
134
+ return conn !== undefined && isUsingEnterpriseSso
138
135
}
139
136
140
137
// If there is an active SSO connection
0 commit comments