Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify.Auth.resetPassword not detecting failure #296

Closed
brunovsiqueira opened this issue Jan 5, 2021 · 5 comments
Closed

Amplify.Auth.resetPassword not detecting failure #296

brunovsiqueira opened this issue Jan 5, 2021 · 5 comments
Labels
auth Issues related to the Auth Category bug Something is not working; the issue has reproducible steps and has been reproduced pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days.

Comments

@brunovsiqueira
Copy link

brunovsiqueira commented Jan 5, 2021

Hey there.

I was testing the Amplify resetPassword method and I noticed that when you send an incorrect and a correct username it responds the same way. When an nonexistent username is unputed, no exception is thrown nor does the ResetPasswordResult object differs.

However, I would like to let my user know when he inputed the wrong username. Is there anyway to achieve this?

@haverchuck haverchuck added auth Issues related to the Auth Category bug Something is not working; the issue has reproducible steps and has been reproduced labels Jan 7, 2021
@brunovsiqueira
Copy link
Author

Any updates on this?

@haverchuck
Copy link
Contributor

@brunovsiqueira We have refactored our error handling library-wide as part of an upcoming release. This should help satisfy the use case you've outlined.

@haverchuck haverchuck added the pending-release Issues that have been addressed in main but have not been released label Feb 9, 2021
@haverchuck
Copy link
Contributor

@brunovsiqueira I have tested, and we throw an AuthException when a non-existant user is passed to the resetPassword method IF the UserPool is configured to not prevent a User Existance error:
image

You can find this configuration in the User Pool console, under the App Clients section.

@haverchuck haverchuck added pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days. and removed pending-release Issues that have been addressed in main but have not been released labels Feb 25, 2021
@haverchuck
Copy link
Contributor

Closing this issue due to inactivity and inability to reproduce.

@brunovsiqueira
Copy link
Author

brunovsiqueira commented Mar 4, 2021

Sorry for the late response.

My "Prevent User Existence Errors" is configured as Enabled and when I send any non existing username to the resetPassword method no AuthException is thrown and I get this response:

result = {CognitoResetPasswordResult} isPasswordReset = false nextStep = {ResetPasswordStep} additionalInfo = {_InternalLinkedHashMap} size = 0 codeDeliveryDetails = {AuthCodeDeliveryDetails} updateStep = "CONFIRM_RESET_PASSWORD_WITH_CODE"

@haverchuck in the documentation I found:
"The error response works when the status is ENABLED and the user doesn't exist. "

Shouldn't an UserNotFoundException be thrown?

Additionally, resetPassword method is returning the response mentioned above when user exists but is in the FORCE_CHANGE_PASSWORD status. I think the response should not be the same for these different use cases.

Can you please reopen it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues related to the Auth Category bug Something is not working; the issue has reproducible steps and has been reproduced pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants