Skip to content

Commit

Permalink
Revert "fix: insert hostedUIProviderCreds empty array on hostedUI (#6485
Browse files Browse the repository at this point in the history
)" (#6682)

This reverts commit 5ebee51.
  • Loading branch information
ammarkarachi authored Feb 19, 2021
1 parent c326c9c commit 4185595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 4185595

Please sign in to comment.