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(aws-amplify): preserve default auth providers with repetitive calls of configure #12478

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented Oct 31, 2023

Description of changes

Added additional condition check for initializing default auth provider with repetitive calls of Amplify.configure. This fix the following issue:

The following code snippet will remove the default auth providers initialized for option ssr: true.

Amplify.configure(config, { ssr: true });

Amplify.configure({
    ...Amplify.getConfig(),
    Analytics: {
        Kinesis: {
            region: 'us-west-2'
        },
    },
});

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

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

@HuiSF HuiSF requested a review from a team as a code owner October 31, 2023 16:53
@HuiSF HuiSF changed the title fix(aws-amplify): preserve default auth providers with repetitive cal… fix(aws-amplify): preserve default auth providers with repetitive calls of configure Oct 31, 2023
if (
resolvedResourceConfig.Auth &&
!libraryOptions?.Auth &&
!Amplify.libraryOptions.Auth
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder this should be private?

Copy link
Contributor

@elorzafe elorzafe left a comment

Choose a reason for hiding this comment

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

Looks good

Thanks @HuiSF

@HuiSF HuiSF merged commit aaa7e98 into main Oct 31, 2023
28 checks passed
@HuiSF HuiSF deleted the hui/fix/aws-amplify/preserve-default-auth-providers branch October 31, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants