Skip to content

Commit

Permalink
chore: revert previous change but keep added test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
awsluja committed May 20, 2024
1 parent 37a4fdf commit 438ccf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/auth-construct/src/construct.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,7 @@ void describe('Auth construct', () => {
oauthRedirectSignIn: 'http://callback.com',
oauthRedirectSignOut: 'http://logout.com',
oauthResponseType: 'code',
// see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-supportedidentityproviders
socialProviders: `["${googleProvider.providerName}","${facebookProvider.providerName}","${amazonProvider.providerName}","${appleProvider.providerName}","${provider1}","${provider2}","${unnamedProvider}"]`,
socialProviders: `["GOOGLE","FACEBOOK","LOGIN_WITH_AMAZON","SIGN_IN_WITH_APPLE","${provider1}","${provider2}","${unnamedProvider}"]`,
allowUnauthenticatedIdentities: 'true',
mfaConfiguration: 'OFF',
mfaTypes: '[]',
Expand Down
18 changes: 4 additions & 14 deletions packages/auth-construct/src/construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -969,20 +969,10 @@ export class AmplifyAuth
});
output.mfaTypes = JSON.stringify(mfaTypes);

// extract providers from CfnIdentityPool.supportedLoginProviders
// see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-supportedidentityproviders
const cfnUserPoolProviders =
this.resources.cfnResources.cfnUserPoolClient.supportedIdentityProviders;
if (cfnUserPoolProviders) {
const providersToOutput = [];
for (const provider of cfnUserPoolProviders) {
if (provider !== 'COGNITO') {
providersToOutput.push(provider);
}
}
if (providersToOutput.length > 0) {
output.socialProviders = JSON.stringify(providersToOutput);
}
if (this.providerSetupResult.providersList.length > 0) {
output.socialProviders = JSON.stringify(
this.providerSetupResult.providersList
);
}

//TODO: extract callback URLs from cfn and remove this block below
Expand Down

0 comments on commit 438ccf0

Please sign in to comment.