Skip to content

Amplify v2 resetPassword throws an error while v1.3X works fine #2179

@PineapplePie

Description

@PineapplePie

Before opening, please confirm:

Language and Async Model

Kotlin

Amplify Categories

Authentication

Gradle script dependencies

// Put output below this line

 implementation "com.amplifyframework:aws-auth-cognito:2.0.0"

Environment information

# Put output below this line

------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

Hey! I've migrated the project from v1.31.2 to v2.0.0. All configurations are the same, I've checked the migration guide and except for the small change in the similar flow - confirmResetPassword() I didn't find anything new (that I had to change in order to migrate correctly).
While the previous version of SDK gives the perfect result (a not authorized user that forgot a password, receives an email with a code for entering a new password) in 100% cases, v2 just returns me an error each time I'm trying to do the same thing.

Providing an existing email, I'm getting this:

NotAuthorizedException{message=Failed since user is not authorized., cause=NotAuthorizedException(message=Client XYZ is configured for secret but secret was not received), recoverySuggestion=Check whether the given values are correct and the user is authorized to perform the operation.}
Any idea how to fix that?

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.
Amplify.Auth.resetPassword(email, {
            continuation.resume(Resource.Data(Unit))                 
        }, {
            continuation.resume(handleError(it))
        })

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

authRelated to the Auth category/pluginsbugSomething isn't workingpending-releaseCode has been merged but pending release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions