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

fix(auth): throw correct auth exception for code mismatch #1370

Merged
merged 13 commits into from
Jun 11, 2021
Merged

fix(auth): throw correct auth exception for code mismatch #1370

merged 13 commits into from
Jun 11, 2021

Conversation

div5yesh
Copy link
Contributor

Issue #, if available: #1102

Description of changes:
Throw AuthException with correct message and recovery suggestion mapped to Cognito exception instead of generic exception.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@div5yesh div5yesh requested a review from a team June 10, 2021 02:27
Copy link
Contributor

@changxu0306 changxu0306 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good. But I think similar changes should also be made in the onError() callback for fetchAuthSession(), resetPassword(), confirmResetPassword(), updatePassword(), fetchUserAttributes(), etc. in AWSCognitoAuthPlugin. By doing that, we won't need to fix this class again if similar issues is reported in the future.

div5yesh and others added 4 commits June 10, 2021 10:05
@div5yesh div5yesh requested a review from changxu0306 June 11, 2021 17:21
div5yesh and others added 4 commits June 11, 2021 13:05
Co-authored-by: Chang Xu <42978935+changxu0306@users.noreply.github.com>
Co-authored-by: Chang Xu <42978935+changxu0306@users.noreply.github.com>
@div5yesh div5yesh requested a review from changxu0306 June 11, 2021 20:49
Copy link
Contributor

@changxu0306 changxu0306 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it 🚢

@div5yesh div5yesh merged commit 4cd7cfe into aws-amplify:main Jun 11, 2021
@div5yesh div5yesh deleted the fix/auth-exception-message branch June 11, 2021 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants