amplify-flutter
amplify-flutter copied to clipboard
Username is cached for use in confirmPassword on Android
Describe the bug Amplify.Auth.confirmPassword is not displaying any error when the email/username and the Verification Code don't match. In JS the check exists.
To Reproduce Steps to reproduce the behavior:
- Reset password
- Copy the Verification Code from the email
- Paste the Verification Code
- Insert a wrong e-mail address
Expected behavior Expected an error message
Platform Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply): [x] Android [] iOS (I don't know)
pubspec.yaml ... amplify_flutter: "<1.0.0" amplify_auth_cognito: "<1.0.0" ...
@ssantomauro How are you trying to catch the error?
This is my code:
try {
await Amplify.Auth.confirmPassword(
username: email,
newPassword: newPassword,
confirmationCode: verificationCode);
} catch (error) {
print(error);
throw (error);
}
It's the way I'm using for the signIn and signOut as well.
@ssantomauro Ok I think I found the issue. In Android, our underlying amplify-android library just caches the username when the initial resetPassword method is called (while iOS requires it to be passed). We will work to resolve this discrepancy.
Thanks!
Hello @ssantomauro - We have recently released a new developer preview version of the Auth category (amplify_flutter v1.0.0-next.0). This new version is a full re-write of the auth category in dart, and it supports Mobile, Desktop, and Web. This issue is addressed in this new version. You can read more about the developer preview release in the blog post and docs. I will update this issue again once this new version is out of developer preview.
Let me know if you have any questions!
This issue has been addressed in v1.0.0 of Amplify Flutter, which is now stable. This release also includes web and desktop support for Auth, API, Analytics, and Storage. You can see the list of new features and bug fixes in the release notes, and see more details on how to migrate in the upgrade guide.