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

Error description could be more precise when resetting password several times on a row #83

Closed
merbula opened this issue Jun 13, 2024 · 7 comments
Labels
question Further information is requested

Comments

@merbula
Copy link

merbula commented Jun 13, 2024

Hi,

When user resets the password several times on a row, following error is given: "Sorry, something went wrong".
The error description should be more instructive for the user.

I´m calling functions resetPassword() and confirmResetPassword() from custom UI´s.

Thanks!

@merbula
Copy link
Author

merbula commented Jun 13, 2024

Not sure if this is your job but.. Also tested the password update functionality too.

Updating the password with several times on a row does not give any error for the user. In my opinion user should be informed with appropriate error text.

Used Amplify.Auth.update(oldPassword: xxx, to: xxx) to update password.

Log:
Failed execution for Auth.changePasswordAPI with error:
AuthError: Attempt limit exceeded, please try after some time.
Recovery suggestion: Make sure that the request made to the particular AWS resources are under the resource quota limits
Caused by:
limitExceeded

@ruisebas ruisebas added the question Further information is requested label Jun 13, 2024
@ruisebas
Copy link
Member

Hi @merbula, thanks for opening this issue.

Regarding your first question, could you please enable verbose logging (by adding Amplify.Logging.logLevel = .verbose before Amplify.configure()) and either share the logs with us or check what is the underlying error? The most likely reason is that there is no default string defined for said error.

Regarding your second question, the Authenticator doesn't really support the update password flow, so I was wondering how you are testing it.
Having said that, the error message you shared seems to be pretty informative.

@ruisebas ruisebas added the pending-community-response Issue is pending response from the issue requestor label Jun 13, 2024
@merbula
Copy link
Author

merbula commented Jun 14, 2024

My apologies, forgot to add log in my first question. Here is something:

Failed execution for Auth.resetPasswordAPI with error:
AuthError: Attempt limit exceeded, please try after some time.
Recovery suggestion: Make sure that the request made to the particular AWS resources are under the resource quota limits
Caused by:
limitExceeded
Unable to initialize a password reset
The operation couldn’t be completed. (Amplify.AuthError error 1.)

Like you said, there is not default error text specified so it is giving the unknown text.

@github-actions github-actions bot removed the pending-community-response Issue is pending response from the issue requestor label Jun 14, 2024
@ruisebas
Copy link
Member

The Authenticator only ships with messages for the most common errors, as you can see here.

However since this is a known Cognito error, the Authenticator allows you to define a custom error message by having a key with the format authenticator.cognitoError.{CognitoError} in to your app's Localizable.strings file.

For this particular example, it would be:

"authenticator.cognitoError.limitExceeded" = "You've reached the limit of requests. Please wait a couple of minutes and try again";

@merbula
Copy link
Author

merbula commented Jun 17, 2024

Yes, i have seen those common errors. But is there a list available for the all possible Cognito errors? This .limitExceeded came out of the bushes.

@harsh62
Copy link
Member

harsh62 commented Jun 17, 2024

@merbula You can find the list of Cognito errors here.

Copy link

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.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants