amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

Unconfirmed email in cognito user-pool

Open AsitDixit opened this issue 2 years ago • 1 comments

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

Authentication

Amplify Categories

No response

Environment information

lambda js

Describe the bug

I'm filtering email in pre-signup lambda function those emails are in cognito user-pool can't be used again for sign up, but there is a situation if user leaves an email unconfirmed and latter user uses that mail for signup then pre-signup function will not allow because there is already an entry with same email(but unconfirmed). Tell me should I filter email in lambda or remove the lambda and allow duplicate entries?

Expected behavior

I want when user enters the same unconfirmed email , it should say email already exist send code for verification.

Reproduction steps

  1. Used forcealiasauth
  2. required attribute email only
  3. User can sign in through email & preferred username

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

AsitDixit avatar Aug 06 '22 05:08 AsitDixit

Hi @AsitDixit 👋

I'm taking a look at this issue but first off, i'd like to confirm the following:

  • Are your Cognito user pool sign-in options set to User name or email?
  • If set to User name, is the pre-sign up lambda trigger checking for the email in attributes of the existing users?

Also note that to send a code that confirms an existing user, you would implement Auth.resendSignUp(username) to send a code to the user, then confirm by using the code that was sent to the user with Auth.confirmSignUp(username, code).

nadetastic avatar Aug 09 '22 19:08 nadetastic

Hi @AsitDixit, following up on this - let me know if your still facing this issue

nadetastic avatar Aug 16 '22 14:08 nadetastic

Solved

AsitDixit avatar Aug 23 '22 15:08 AsitDixit

@AsitDixit glad you were able to get this resolved. Any information on what the fix was?

nadetastic avatar Sep 12 '22 18:09 nadetastic