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

Amplify.Auth.signUp returns 'isSignUpComplete = true' when signUpStep is 'CONFIRM_SIGN_UP_STEP'

Open haverchuck opened this issue 4 years ago • 5 comments

When calling Amplify.Auth.signUp(...), the response includes a nextStep.signUpStep value of CONFIRM_SIGN_UP_STEP, while at the same time an isSignUpComplete value of true.

My expectation is that the isSignUpComplete value should only be true if signUpStep is DONE.

image

This code is being called from the Android platform code of a Flutter plugin, but I do not expect that this would make a difference.

haverchuck avatar Jul 31 '20 01:07 haverchuck

Hey, this is intended behavior. You are successfully signed up at this point - it's just that there is an additional step you can take of confirming your account which is needed to sign in.

TrekSoft avatar Aug 17 '20 14:08 TrekSoft

Hey, this is intended behavior. You are successfully signed up at this point - it's just that there is an additional step you can take of confirming your account which is needed to sign in.

This is exactly the opposite of my recollection: I thought we interpreted that flag as a convenience to mean "there are no remaining steps." In our discussions, we even talked about implementing it in iOS as a computed property returning the results of nextStep == .done. The semantic meaning was "the flow is done; my expectation of a successful 'sign up' is that a user can now sign in."

palpatim avatar Sep 08 '20 22:09 palpatim

I believe the reason we digressed from if nextStep == null then done here is because you are indeed completely signed up after the success callback comes back. If you got isSignedUp = false and then tried to sign up again, it would give you an error, "User is already signed up" which is contradictory.

The fact that there are additional next steps you can take (not necessary for completing sign up but necessary for being able to sign in) doesn't change the fact that you are signed up at that point.

TrekSoft avatar Sep 09 '20 14:09 TrekSoft

got this as well. went through the amplify tutorial for flutter, but used the latest amplify version, so it enterd this issue. It works with:

if (result.isSignUpComplete) {
        if (result.nextStep is AuthNextSignUpStep) {
          //enter verify flow
        }
        // signup was ok. do login
        loginWithCredentials(credentials);
      }

andreimcristof avatar Jan 11 '21 22:01 andreimcristof

Re-opening the issue, as per discussion we decided to fix this in Android. Since this is a breaking change, we might add this in the next major version update. Here are the different scenarios:


// SignUp needs to confirm using SMS
nextStep -> .confirmUser(SMS)
isSignupComplete -> false 

// SignUp needs to confirm, but not email/SMS provided
nextStep -> .confirmUser(nil)
isSignupComplete -> false 

// SignUp confirmed
nextStep -> .done
isSignupComplete -> false 

royjit avatar Jun 03 '22 18:06 royjit

Hello @haverchuck we have addressed and fixed this in the V2 version of Amplify library for Android. If upgrading is an option for you please try that out.

gpanshu avatar Nov 18 '22 21:11 gpanshu

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Nov 18 '22 21:11 github-actions[bot]