sst.dev icon indicating copy to clipboard operation
sst.dev copied to clipboard

Set proper UsernameAttributes in Cognito User Pool

Open esbenvb opened this issue 7 years ago • 3 comments

The current configuration does not create a User Pool similar to the one described on https://serverless-stack.com/chapters/create-a-cognito-user-pool.html, and the user cannot sign up with email/password.

This PR fixes that configuration

esbenvb avatar May 24 '18 13:05 esbenvb

@esbenvb It looks like CloudFormation has added support for this over the last few weeks. This means that this chapter that follows later in the tutorial is not necessary anymore - https://serverless-stack.com/chapters/signup-with-email-as-alias.html. I can't quite accept this PR yet since it needs a change to the frontend portion as well. But thanks for trying it out.

jayair avatar May 24 '18 19:05 jayair

@jayair which frontend changes are you thinking of?

I tested my local react client with the auto-deployed backend as soon as i got through the cloudformation steps, and I got an error when trying to sign up a user using my local react client. I debugged this and saw that the cognito user pool that was created by cloudformation was not matching the one we created earlier in the tutorial.

Fixing the single line in this PR, made it all work.

esbenvb avatar May 24 '18 22:05 esbenvb

@esbenvb It's what comes ahead in the tutorial. You were probably testing it with the app from the first part of the tutorial. Here is the changeset for the frontend - https://github.com/AnomalyInnovations/serverless-stack-demo-client/compare/v3.0...v3.1.

jayair avatar May 25 '18 20:05 jayair