Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add HostedUIProvider dependency to OAuth Custom Lambda #9878

Merged
merged 4 commits into from
Mar 2, 2022

Conversation

edwardfoyle
Copy link
Member

Description of changes

Adds a dependency from the oAuthCustomResource to the hostedUIProvidersCustomResource. The lack of this dependency caused push failures when updating oAuth config with a new provider as the new provider was not added before attempting to update the provider config.

Also removed some unused method parameters and fixed a class name typo.

Issue #, if available

fixes #7388

Description of how you validated changes

Manually verified and added a unit test

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@edwardfoyle edwardfoyle requested a review from a team as a code owner March 1, 2022 00:27
@edwardfoyle edwardfoyle changed the title Lambda callout dep fix: add HostedUIProvider dependency to OAuth Custom Lambda Mar 1, 2022
expect(
cognitoStack
.oAuthCustomResource!.node!.dependencies!.map((dep: any) => dep.target.logicalId)
.map(logicalIdToken => /testCognitoStack\.([^\.]+)\.Default/.exec(logicalIdToken)![1]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move this to a named function for readability

Copy link
Contributor

@sachscode sachscode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
just some nits

this.oAuthCustomResource.node.addDependency(this.hostedUICustomResourceInputs!.node!.defaultChild!);
this.oAuthCustomResource.node.addDependency(this.hostedUIProvidersCustomResourceInputs!.node!.defaultChild!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:Can we throw an exception here if this.hostedUIProvidersCustomResourceInputs ..defaultChild is falsey

@sachscode sachscode merged commit a385de9 into aws-amplify:master Mar 2, 2022
@github-actions github-actions bot added the referenced-in-release Issues referenced in a published release changelog label Mar 7, 2022
@github-actions
Copy link

github-actions bot commented Mar 7, 2022

👋 Hi, this pull request was referenced in the v7.6.23 release!

Check out the release notes here https://github.com/aws-amplify/amplify-cli/releases/tag/v7.6.23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
referenced-in-release Issues referenced in a published release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding social sign-on to preexisting cognito pool fails
3 participants