Skip to content

It's possible to change email without confirmation code #3088

Open
@KamilSucharski

Description

@KamilSucharski

Before opening, please confirm:

Language and Async Model

RxJava

Amplify Categories

Authentication

Gradle script dependencies

implementation 'com.amplifyframework:core:2.29.1'
implementation 'com.amplifyframework:aws-auth-cognito:2.29.1'
implementation 'com.amplifyframework:rxbindings:2.29.1'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'

Environment information

Welcome to Gradle 8.14.2!

Here are the highlights of this release:
 - Java 24 support
 - GraalVM Native Image toolchain selection
 - Enhancements to test reporting
 - Build Authoring improvements

For more details see https://docs.gradle.org/8.14.2/release-notes.html


------------------------------------------------------------
Gradle 8.14.2
------------------------------------------------------------

Build time:    2025-06-05 13:32:01 UTC
Revision:      30db2a3bdfffa9f8b40e798095675f9dab990a9a

Kotlin:        2.0.21
Groovy:        3.0.24
Ant:           Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM:  21.0.6 (JetBrains s.r.o. 21.0.6+-13391695-b895.109)
Daemon JVM:    D:\Programs\Android\Android Studio\jbr (no JDK specified, using current Java home)
OS:            Windows 11 10.0 amd64

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

When I run the below code, I first get:

AuthUpdateAttributeResult{isUpdated=false, nextStep=AuthNextUpdateAttributeStep{updateAttributeStep=CONFIRM_ATTRIBUTE_WITH_CODE, additionalInfo={}, codeDeliveryDetails=AuthCodeDeliveryDetails{destination='***@***', deliveryMedium=EMAIL, attributeName='email'}}}

Which is expected, as I should navigate to another screen to enter the confirmation code. But if the user triggers it again with the same data (for example, after clicking the back button), then the SDK returns a different result:

AuthUpdateAttributeResult{isUpdated=true, nextStep=AuthNextUpdateAttributeStep{updateAttributeStep=DONE, additionalInfo={}, codeDeliveryDetails=null}}

Which means the user has bypassed the confirmation code, and forced the new email to be accepted, simply by running the same method twice.

Reproduction steps (if applicable)

No response

Code Snippet

RxAmplify
    .Auth
    .updateUserAttribute(
        AuthUserAttribute(
            AuthUserAttributeKey.email(),
            email
        )
     )
    .map { result ->
        // Result handling
    }

Log output

No response

Configuration File

No response

GraphQL Schema

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to the Auth category/pluginsclosing soonThis issue will be closed in 7 days unless further comments are made.questionGeneral question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions