Skip to content

Commit

Permalink
chore: more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk committed Jul 10, 2023
1 parent 3eab8be commit 7aeddf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
"NONE",
],
},
"ShouldOutputAppClientSecrets": {
"Fn::Equals": [
{
"Ref": "userpoolClientGenerateSecret",
},
true,
],
},
},
"Description": "Amplify Cognito Stack for AWS Amplify CLI",
"Outputs": {
Expand All @@ -35,15 +27,6 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
"Ref": "UserPoolClientWeb",
},
},
"AppClientSecret": {
"Condition": "ShouldOutputAppClientSecrets",
"Value": {
"Fn::GetAtt": [
"UserPoolClientInputs",
"appSecret",
],
},
},
"IdentityPoolId": {
"Description": "Id for the identity pool",
"Value": {
Expand Down Expand Up @@ -359,9 +342,6 @@ exports[`Check Auth Template Generated authstack template in default flow 1`] =
"Type": "AWS::Cognito::UserPoolClient",
},
"UserPoolClientRole": {
"DependsOn": [
"UserPoolClient",
],
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
Expand Down Expand Up @@ -445,14 +425,6 @@ exports[`Check Auth Template Generated authstack template in manual flow 1`] = `
"NONE",
],
},
"ShouldOutputAppClientSecrets": {
"Fn::Equals": [
{
"Ref": "userpoolClientGenerateSecret",
},
true,
],
},
},
"Description": "Amplify Cognito Stack for AWS Amplify CLI",
"Outputs": {
Expand All @@ -473,15 +445,6 @@ exports[`Check Auth Template Generated authstack template in manual flow 1`] = `
"Ref": "UserPoolClientWeb",
},
},
"AppClientSecret": {
"Condition": "ShouldOutputAppClientSecrets",
"Value": {
"Fn::GetAtt": [
"UserPoolClientInputs",
"appSecret",
],
},
},
"AppleWebClient": {
"Value": {
"Ref": "appleAppId",
Expand Down Expand Up @@ -1702,9 +1665,6 @@ exports.handler = (event, context, callback) => {
"Type": "AWS::Cognito::UserPoolClient",
},
"UserPoolClientRole": {
"DependsOn": [
"UserPoolClient",
],
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
],
},
});
this.userPoolClientRole.addDependency(this.userPoolClient!);
}

/**
Expand Down Expand Up @@ -634,7 +633,10 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog
runtime: 'nodejs16.x',
timeout: 300,
});
this.hostedUICustomResource.addDependency(this.userPoolClientRole!);

if (this.userPoolClientRole) {
this.hostedUICustomResource.addDependency(this.userPoolClientRole);
}

// userPool client lambda policy
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,6 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
'AppClientID',
);

this._authTemplateObj.addCfnOutput(
{
value: cdk.Fn.getAtt('UserPoolClientInputs', 'appSecret').toString(),
condition: this._authTemplateObj.getCfnCondition('ShouldOutputAppClientSecrets'),
},
'AppClientSecret',
);

if (!props.useEnabledMfas || configureSMS) {
this._authTemplateObj.addCfnOutput(
{
Expand Down Expand Up @@ -576,14 +568,5 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
},
'ShouldNotCreateEnvResources',
);

if (props.authSelections !== 'identityPoolOnly') {
this._authTemplateObj.addCfnCondition(
{
expression: cdk.Fn.conditionEquals(cdk.Fn.ref('userpoolClientGenerateSecret'), true),
},
'ShouldOutputAppClientSecrets',
);
}
};
}

0 comments on commit 7aeddf4

Please sign in to comment.