@@ -14,8 +14,9 @@ import { messages, showMessageWithCancel, showViewLogsMessage } from '../../shar
1414import { Timeout , waitTimeout } from '../../shared/utilities/timeoutUtils'
1515import { fromExtensionManifest } from '../../shared/settings'
1616import { Profile } from './sharedCredentials'
17- import { createInputBox , promptUser } from '../../shared/ui/input'
1817import { openUrl } from '../../shared/utilities/vsCodeUtils'
18+ import { createInputBox } from '../../shared/ui/inputPrompter'
19+ import { isValidResponse } from '../../shared/wizards/wizard'
1920
2021const credentialsTimeout = 300000 // 5 minutes
2122const credentialsProgressDelay = 1000
@@ -113,18 +114,16 @@ const errorMessageUserCancelled = localize('AWS.error.mfa.userCancelled', 'User
113114 */
114115export async function getMfaTokenFromUser ( mfaSerial : string , profileName : string ) : Promise < string > {
115116 const inputBox = createInputBox ( {
116- options : {
117- ignoreFocusOut : true ,
118- placeHolder : localize ( 'AWS.prompt.mfa.enterCode.placeholder' , 'Enter Authentication Code Here' ) ,
119- title : localize ( 'AWS.prompt.mfa.enterCode.title' , 'MFA Challenge for {0}' , profileName ) ,
120- prompt : localize ( 'AWS.prompt.mfa.enterCode.prompt' , 'Enter code for MFA device {0}' , mfaSerial ) ,
121- } ,
117+ ignoreFocusOut : true ,
118+ placeholder : localize ( 'AWS.prompt.mfa.enterCode.placeholder' , 'Enter Authentication Code Here' ) ,
119+ title : localize ( 'AWS.prompt.mfa.enterCode.title' , 'MFA Challenge for {0}' , profileName ) ,
120+ prompt : localize ( 'AWS.prompt.mfa.enterCode.prompt' , 'Enter code for MFA device {0}' , mfaSerial ) ,
122121 } )
123122
124- const token = await promptUser ( { inputBox : inputBox } )
123+ const token = await inputBox . prompt ( )
125124
126125 // Distinguish user cancel vs code entry issues with the error message
127- if ( ! token ) {
126+ if ( ! isValidResponse ( token ) ) {
128127 throw new Error ( errorMessageUserCancelled )
129128 }
130129
0 commit comments