From 7b5de7b553e189a47c88e2902a0f21744a16dc10 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Fri, 27 Aug 2021 13:47:50 -0400 Subject: [PATCH] Revert "fix(amplify-provider-awscloudformation): display mfa prompt (#7866)" (#8054) This reverts commit 8947b187bf7a7ff6c998488a9931839ca3169d02. The original commit was causing E2E test failures. Co-authored-by: Colin Ihrig --- .../awscloudformation/secrets/ssmClientWrapper.ts | 1 - packages/amplify-cli/src/commands/push.ts | 1 - .../src/system-config-manager.ts | 9 ++------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/ssmClientWrapper.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/ssmClientWrapper.ts index 4e1809cc50c..00a08df2b27 100644 --- a/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/ssmClientWrapper.ts +++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/secrets/ssmClientWrapper.ts @@ -102,7 +102,6 @@ export class SSMClientWrapper { const getSSMClient = async (context: $TSContext) => { const spinner = ora('Initializing SSM Client'); - context.exeInfo.spinner = spinner; try { spinner.start(); diff --git a/packages/amplify-cli/src/commands/push.ts b/packages/amplify-cli/src/commands/push.ts index 87a9e9d563e..426839e4fce 100644 --- a/packages/amplify-cli/src/commands/push.ts +++ b/packages/amplify-cli/src/commands/push.ts @@ -10,7 +10,6 @@ const spinner = ora(''); // to push his local developments async function syncCurrentCloudBackend(context: $TSContext) { context.exeInfo.restoreBackend = false; - context.exeInfo.spinner = spinner; const currentEnv = context.exeInfo.localEnvInfo.envName; diff --git a/packages/amplify-provider-awscloudformation/src/system-config-manager.ts b/packages/amplify-provider-awscloudformation/src/system-config-manager.ts index 18d7b755006..870731bc9d6 100644 --- a/packages/amplify-provider-awscloudformation/src/system-config-manager.ts +++ b/packages/amplify-provider-awscloudformation/src/system-config-manager.ts @@ -123,7 +123,7 @@ async function getRoleCredentials(context: $TSContext, profileName: string, prof context.print.info(` ${profileConfig.role_arn}`); context.print.info('It requires MFA authentication. The MFA device is'); context.print.info(` ${profileConfig.mfa_serial}`); - mfaTokenCode = await getMfaTokenCode(context); + mfaTokenCode = await getMfaTokenCode(); } logger('getRoleCredentials.aws.STS', [sourceProfileAwsConfig])(); const sts = new aws.STS(sourceProfileAwsConfig); @@ -156,11 +156,7 @@ async function getRoleCredentials(context: $TSContext, profileName: string, prof return roleCredentials; } -async function getMfaTokenCode(context) { - let spinner; - if (context.exeInfo.spinner && context.exeInfo.spinner.isSpinning) { - spinner = context.exeInfo.spinner.stopAndPersist(); - } +async function getMfaTokenCode() { const inputMfaTokenCode = { type: 'input', name: 'tokenCode', @@ -178,7 +174,6 @@ async function getMfaTokenCode(context) { }, }; const answer = await inquirer.prompt(inputMfaTokenCode); - if (spinner) spinner.start(); return answer.tokenCode; }