I did not understand your question completely but I think my explanation will help anyway.

You will get "UsernameExistsException" when you try to Signup the user again.

But, the 'UserNotConfirmedException' is returned when you try to login with this user. Hence this needs to be handled in Sign in.

What you need is something like this.

    handleSubmit = async event => {

    this.setState({ isLoading: true });

    try {
        const newUser = await Auth.signUp({
            password: this.state.password, 'attributes': {
        } catch (e) {
            if( === 'UsernameExistsException') {
                alert("You are already registered. Resending the verification code to " +;
                await Auth.resendSignUp(;
                this.state.resent = true;
            } else {

    this.setState({ isLoading: false });


I'm not sur what do you really want, but if you want to find way to retrieve the information about the status of the user in order to manage a specific workflow, you have to check the challengeName and challengeParam. For instance, when you signIn a new user, the auth.signIn, return a cognito User: if this user is not confirmed the user will have a challengeName and challengeParm attributes than you can verify within your code for example: I create a user from the console with a temporary password so he was in new password required status, from the code I did this to be able to complete the new password workflow

  return fromPromise(Auth.signIn(username, password)).pipe(
   tap(user => {
     console.log('signIn Methode', user)
      if (user.challengeName === 'NEW_PASSWORD_REQUIRED') {
  }), catchError(..){ }

Here below, you can see the answer that I display from the console.log user with "NEW PASSWORD REQUIRED STATUS"

If the user is confirmed you will not see the challengeName/challangeParm.

hope this will help you.

Related Query

More Query from same tag