amazon-archives / amazon-cognito-identity-js

Amazon Cognito Identity SDK for JavaScript
Other
984 stars 454 forks source link

Cannot reset password for the user as there is no registered/verified email or phone_number #678

Closed Ashirogi-Muto closed 6 years ago

Ashirogi-Muto commented 6 years ago

I have a user in the user pool whose status is CONFIRMED but when I use this user's email to trigger forgot password flow I get this error in the response. The configuration is set to auto verify for the email and an email is sent to the user with the password which is asked to be changed on the first login. Is there any other configuration that I need to do for this?

PrashanthThugaiah commented 6 years ago

Hi,

How did you create that user?

  1. programmatically : using adminCreateUser() ?
  2. manually : through cognito console?

Even I had faced this issue: i had created the user in method 1(programmatically : using adminCreateUser() )

I fixed this issue by passing additional two parameters(email_verified, phone_number_verified) while creating the user.

code: UserAttributes: [ { Name: 'name', / required / Value: body.first_name }, { Name: 'family_name', / required / Value: body.last_name }, { Name: 'email', / required / Value: body.email }, { Name: 'phone_number', / required / Value: body.phone_number }, { Name: 'email_verified', / required / Value: 'true' }, { Name: 'phone_number_verified', / required / Value: 'true' }, ]

Ashirogi-Muto commented 6 years ago

I created the user programmatically too.

Ashirogi-Muto commented 6 years ago

Thanks @PrashanthThugaiah. It worked 👍