From 41855953b074fe4179a68a4acaf9796515e12688 Mon Sep 17 00:00:00 2001 From: Ammar <56042290+ammarkarachi@users.noreply.github.com> Date: Fri, 19 Feb 2021 10:29:56 -0800 Subject: [PATCH] Revert "fix: insert hostedUIProviderCreds empty array on hostedUI (#6485)" (#6682) This reverts commit 5ebee516373c0544f1400f054eb382bb5b887253. --- .../src/provider-utils/awscloudformation/index.js | 5 ++--- .../src/resourceParams.js | 8 +------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/index.js b/packages/amplify-category-auth/src/provider-utils/awscloudformation/index.js index 2a7428e7904..210ceaaeae6 100644 --- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/index.js +++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/index.js @@ -145,10 +145,9 @@ async function updateConfigOnEnvInit(context, category, service) { if (hostedUIProviderMeta) { currentEnvSpecificValues = getOAuthProviderKeys(currentEnvSpecificValues, resourceParams); } - const isPullingOrNewEnv = context.input.command === 'pull' || context.input.command === 'env'; - // don't ask for env_specific params when creating a new env or pulling + srvcMetaData.inputs = srvcMetaData.inputs.filter( - input => ENV_SPECIFIC_PARAMS.includes(input.key) && !Object.keys(currentEnvSpecificValues).includes(input.key) && !isPullingOrNewEnv, + input => ENV_SPECIFIC_PARAMS.includes(input.key) && !Object.keys(currentEnvSpecificValues).includes(input.key), ); const serviceWalkthroughSrc = `${__dirname}/service-walkthroughs/${serviceWalkthroughFilename}`; diff --git a/packages/amplify-provider-awscloudformation/src/resourceParams.js b/packages/amplify-provider-awscloudformation/src/resourceParams.js index a9133f78048..891d5e80fa8 100644 --- a/packages/amplify-provider-awscloudformation/src/resourceParams.js +++ b/packages/amplify-provider-awscloudformation/src/resourceParams.js @@ -1,7 +1,5 @@ const path = require('path'); const fs = require('fs-extra'); -const _ = require('lodash'); -const hostedUIProviderCredsField = 'hostedUIProviderCreds'; function getResourceDirPath(context, category, resource) { const { projectPath } = context.migrationInfo || context.amplify.getEnvInfo(); @@ -41,11 +39,7 @@ function loadResourceParameters(context, category, resource) { parameters = context.amplify.readJsonFile(parametersFilePath); } const envSpecificParams = context.amplify.loadEnvResourceParameters(context, category, resource); - let resourceParameters = { ...parameters, ...envSpecificParams }; - if (category === 'auth' && parameters && parameters.hostedUI && !resourceParameters[hostedUIProviderCredsField]) { - resourceParameters = _.set(resourceParameters, hostedUIProviderCredsField, '[]'); - } - return resourceParameters; + return { ...parameters, ...envSpecificParams }; } module.exports = {