@@ -339,11 +339,6 @@ export class Auth implements AuthService, ConnectionManager {
339339 metadata : { connectionState : 'unauthenticated' } ,
340340 } )
341341
342- // Remove the split session logout prompt, if it exists.
343- if ( ! isAmazonQ ( ) ) {
344- await globals . globalState . update ( 'aws.toolkit.separationPromptDismissed' , true )
345- }
346-
347342 try {
348343 ; ( await tokenProvider . getToken ( ) ) ?? ( await tokenProvider . createToken ( ) )
349344 const storedProfile = await this . store . addProfile ( id , profile )
@@ -1136,71 +1131,3 @@ export function hasVendedIamCredentials(isC9?: boolean, isSM?: boolean) {
11361131 isSM ??= isSageMaker ( )
11371132 return isSM || isC9
11381133}
1139-
1140- type LoginCommand = 'aws.toolkit.auth.manageConnections' | 'aws.codecatalyst.manageConnections'
1141- /**
1142- * Temporary class that handles notifiting users who were logged out as part of
1143- * splitting auth sessions between extensions.
1144- *
1145- * TODO: Remove after some time.
1146- */
1147- export class SessionSeparationPrompt {
1148- // Local variable handles per session displays, e.g. we forgot a CodeCatalyst connection AND
1149- // an Explorer only connection. We only want to display once in this case.
1150- // However, we don't want to set this at the global state level until a user interacts with the
1151- // notification in case they miss it the first time.
1152- #separationPromptDisplayed = false
1153-
1154- /**
1155- * Open a prompt for that last used command name (or do nothing if no command name has ever been passed),
1156- * which is useful to redisplay the prompt after reloads in case a user misses it.
1157- */
1158- public async showAnyPreviousPrompt ( ) {
1159- const cmd = globals . globalState . tryGet ( 'aws.toolkit.separationPromptCommand' , String )
1160- return cmd ? await this . showForCommand ( cmd as LoginCommand ) : undefined
1161- }
1162-
1163- /**
1164- * Displays a sign in prompt to the user if they have been logged out of the Toolkit as part of
1165- * separating auth sessions between extensions. It will executed the passed command for sign in,
1166- * (e.g. codecatalyst sign in vs explorer)
1167- */
1168- public async showForCommand ( cmd : LoginCommand ) {
1169- if (
1170- this . #separationPromptDisplayed ||
1171- globals . globalState . get < boolean > ( 'aws.toolkit.separationPromptDismissed' )
1172- ) {
1173- return
1174- }
1175-
1176- await globals . globalState . update ( 'aws.toolkit.separationPromptCommand' , cmd )
1177-
1178- await telemetry . toolkit_showNotification . run ( async ( ) => {
1179- telemetry . record ( { id : 'sessionSeparation' } )
1180- this . #separationPromptDisplayed = true
1181- void vscode . window
1182- . showWarningMessage (
1183- 'Amazon Q and AWS Toolkit no longer share connections. Please sign in again to use AWS Toolkit.' ,
1184- 'Sign In'
1185- )
1186- . then ( async ( resp ) => {
1187- await telemetry . toolkit_invokeAction . run ( async ( ) => {
1188- telemetry . record ( { source : 'sessionSeparationNotification' } )
1189- if ( resp === 'Sign In' ) {
1190- telemetry . record ( { action : 'signIn' } )
1191- await vscode . commands . executeCommand ( cmd )
1192- } else {
1193- telemetry . record ( { action : 'dismiss' } )
1194- }
1195-
1196- await globals . globalState . update ( 'aws.toolkit.separationPromptDismissed' , true )
1197- } )
1198- } )
1199- } )
1200- }
1201-
1202- static #instance: SessionSeparationPrompt
1203- public static get instance ( ) {
1204- return ( this . #instance ??= new SessionSeparationPrompt ( ) )
1205- }
1206- }
0 commit comments