Skip to content

Commit

Permalink
fix(aws-appsync): graphqlapi throws incorrect error message for autho…
Browse files Browse the repository at this point in the history
…rizationConfig (#15830)

fixes: #15039

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
peterwoodworth authored Jul 30, 2021
1 parent 4f38fe1 commit 1f23313
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ export class GraphqlApi extends GraphqlApiBase {
private validateAuthorizationProps(modes: AuthorizationMode[]) {
modes.map((mode) => {
if (mode.authorizationType === AuthorizationType.OIDC && !mode.openIdConnectConfig) {
throw new Error('Missing default OIDC Configuration');
throw new Error('Missing OIDC Configuration');
}
if (mode.authorizationType === AuthorizationType.USER_POOL && !mode.userPoolConfig) {
throw new Error('Missing default OIDC Configuration');
throw new Error('Missing User Pool Configuration');
}
});
if (modes.filter((mode) => mode.authorizationType === AuthorizationType.API_KEY).length > 1) {
Expand Down

0 comments on commit 1f23313

Please sign in to comment.