amplify-cli: Auth Sign Up Custom Flow -- username cannot be of email format anymore in `Auth.signUp()`

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

No response

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

5.1.0 - 5.6.0

What operating system are you using?

Debian 10

Amplify Categories

auth

Amplify Commands

Not applicable - problem is in the client code (Javascript)

Describe the bug

The

Amplify.Auth().signUp()

method no longer lets you send the email address as the username when it is an email-only sign-up.

Our method of sign-up used to always work but it just broke in Amplify CLI version 5.2.0.

(NOTE: we don’t use Authenticator, we call the API instead the usual way via code that has worked for many months already)

When you set up for email-only verification and sign-up, you were previously able to supply the email address as the username because the email address is the username in that case.

But that use case no longer works. Here’s the code that used to work and no longer works:

        return Auth.signUp({
            username: email,
            password,
            attributes: { email }
        });

This used to always work. The way in which today it no longer works is this: as soon as you call this function, it returns an error (in the promise) that says:

    Username cannot be of email format, since user pool is configured for email alias.

Expected behavior

Expected the method Auth.signUp() not to return an error saying that the email format cannot be used for username “since user pool is configured for email alias”. I had never asked for anything like “email alias” and am not sure what “email alias” means. I believe the CLI erroneously assumes we are asking for this “email alias” here.

Reproduction steps

Create an auth flow via software where you call

        return Auth.signUp({
            username: email,
            password,
            attributes: { email }
        });

where email is a string variable containing a user’s valid email address

and password is the user’s password

And you’ll get the same error message.

GraphQL schema(s)

Not Applicable

Log output

# Put your logs below this line


Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 17 (1 by maintainers)

Most upvoted comments

Downgrading cli to 5.1.2 solves the problem and creates the pool correctly.

I have the same issue, i select email : image But at the end I have the following configuration : image So when I call the Cognito API to create a user it throws me this back : image

Any updates or estimate when this issue will be solved? We have a project that is stalled because of this. Will move to other platform if this is not solvable.