From e40cf541ea1f07309995dc7844334d209b2d1790 Mon Sep 17 00:00:00 2001 From: John Corser Date: Thu, 22 Jul 2021 12:06:41 -0400 Subject: [PATCH] fix(amplify-category-auth): add handling for undefined autoVerifiedAttributes --- .../resources/cloudformation-templates/auth-template.yml.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs b/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs index 6d27043ab7a..66f51041f7a 100644 --- a/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs +++ b/packages/amplify-category-auth/resources/cloudformation-templates/auth-template.yml.ejs @@ -1,4 +1,4 @@ -<% var autoVerifiedAttributes = props.autoVerifiedAttributes.concat(props.aliasAttributes).filter((attr, i, aliasAttributeArray) => ['email', 'phone_number'].includes(attr) && aliasAttributeArray.indexOf(attr) === i) %> +<% var autoVerifiedAttributes = props.autoVerifiedAttributes ? props.autoVerifiedAttributes.concat(props.aliasAttributes).filter((attr, i, aliasAttributeArray) => ['email', 'phone_number'].includes(attr) && aliasAttributeArray.indexOf(attr) === i) : [] %> AWSTemplateFormatVersion: 2010-09-09 Parameters: @@ -164,7 +164,7 @@ Resources: - <%= autoVerifiedAttributes[x] %> <% } %> <% } %> - <%if (autoVerifiedAttributes.includes('email')) { %> + <%if (autoVerifiedAttributes && autoVerifiedAttributes.includes('email')) { %> EmailVerificationMessage: !Ref emailVerificationMessage EmailVerificationSubject: !Ref emailVerificationSubject <% } %>