aws-amplify / amplify-android

The fastest and easiest way to use AWS from your Android app.
https://docs.amplify.aws/lib/q/platform/android/
Apache License 2.0
245 stars 115 forks source link

confirmSignUp returns userId = null when isSignUpComplete is true #2775

Closed VadymKuriyDev closed 5 months ago

VadymKuriyDev commented 5 months ago

Before opening, please confirm:

Language and Async Model

Kotlin - Coroutines

Amplify Categories

Authentication

Gradle script dependencies

```groovy 2.14.12 ```

Environment information

``` Gradle 8.7 ```

Please include any relevant guides or documentation you're referencing

According

/**
     * If {@link #isSignUpComplete} is true, this returns the newly registered user's id. Otherwise, null.
     * @return the newly registered user's id if {@link #isSignUpComplete} is true. Otherwise, null.
     */

in AuthSignUpResult

Describe the bug

After calling confirmSignUp when isSignUpComplete is true userId is null. Expected - receive newly registered user's id

Code Snippet

val authSignUp = Amplify.Auth.confirmSignUp(name, code)

Log output

``` Response = AuthSignUpResult{isSignUpComplete=true, nextStep=AuthNextSignUpStep{signUpStep=DONE, additionalInfo={}, codeDeliveryDetails=null}, userId=null} ```
joon-won commented 5 months ago

Thank you for the report @VadymKuriyDev, our team member will look into the issue

joon-won commented 5 months ago

Hey @VadymKuriyDev, thank you for your patience. This definitely is a bug on our end, we'll try to fix it, and let you know once it goes live

tylerjroach commented 5 months ago

Hi @VadymKuriyDev,

Sorry for the confusion. We need to correct the documentation on that method. The Cognito service does not return userSub (userId) in the confirmSignUpcall.

https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ConfirmSignUp.html

userSub is only returned from signUp calls. https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SignUp.html

AuthSignUpResult is re-used for both signUp and confirmSignUp, so we will need to adjust the message on the getUserId method.

VadymKuriyDev commented 5 months ago

Hi @tylerjroach, thx for the explanation.

github-actions[bot] commented 5 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.