question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

user pool - link style email verification fails to deploy

See original GitHub issue

Reported by @0xdevalias -

const userPool = new cognito.UserPool(this, 'UserPool', {
  // ..snip..

  userVerification: {
    emailSubject: 'Confirm your account on REDACTED',
    emailBody:
      'Hello {username}, welcome to REDACTED! Use the following link to verify your account: {####}',
    emailStyle: cognito.VerificationEmailStyle.LINK,
    smsMessage:
      'Hello {username}, welcome to REDACTED! Use the following code to verify your account: {####}',
  },

  // ..snip..
})

generates the following error -

1/3 | 8:50:23 PM | UPDATE_FAILED        | AWS::Cognito::UserPool                | UserPool (UserPool6BA7E5F2) The message is invalid. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: c3ce01b4-a431-4475-82fd-fdc30fec3660)
	new UserPool (/Users/devalias/dev/REDACTED/packages/REDACTED-infrastructure/node_modules/@aws-cdk/aws-cognito/lib/user-pool.js:73:26)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
nija-atcommented, Mar 20, 2020

@0xdevalias - Try putting {##Verify Email##} instead of {####}. This might work.

1reaction
nija-atcommented, Mar 22, 2020

@0xdevalias - it seems to me that the correct thing to do here is to not set the EmailVerificationMessage and EmailVerificationSubject properties when the ‘CONFIRM_WITH_LINK’ option is used.

This would look like -

const cfnuserpool = userpool.node.defaultChild as CfnUserPool;
cfnuserpool.emailVerificationMessage = undefined;
cfnuserpool.emailVerificationSubject = undefined;

Can you check if this works for you, and sets up the user pool as you would expect?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::Cognito::UserPool VerificationMessageTemplate
The template for verification messages. ... When your EmailSendingAccount is DEVELOPER , your user pool sends email messages with your own Amazon SES ......
Read more >
AWS Cognito & Amplify Auth - Bad, Bugged, Baffling
The new, not verified email is already taken in the user pool, which blocks any users who might have that email from using...
Read more >
CognitoIdentityProvider — Boto3 Docs 1.26.36 documentation
To configure custom validation, you must create a Pre Sign-up Lambda trigger for the user pool as described in the Amazon Cognito Developer...
Read more >
User Authentication and Authorization with AWS Cognito
One of my blogs which you can find from this Link, explains how to use Google ... AWS Cognito User Pool will send...
Read more >
User authentication with AWS Cognito: The good, the bad and ...
Try to link those accounts yourself! Cognito treats a Google Login with “waschi@gmail.com ” as a totally different account (as EXTERNAL_PROVIDER) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found