-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix(auth): throw correct auth exception for code mismatch #1370
Conversation
There was a problem hiding this 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.
...nito/src/main/java/com/amplifyframework/auth/cognito/util/CognitoAuthExceptionConverter.java
Outdated
Show resolved
Hide resolved
...nito/src/main/java/com/amplifyframework/auth/cognito/util/CognitoAuthExceptionConverter.java
Show resolved
Hide resolved
…to/util/CognitoAuthExceptionConverter.java Co-authored-by: Chang Xu <42978935+changxu0306@users.noreply.github.com>
core/src/main/java/com/amplifyframework/auth/AuthException.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/amplifyframework/auth/AuthException.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/amplifyframework/auth/AuthException.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/amplifyframework/auth/AuthException.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Chang Xu <42978935+changxu0306@users.noreply.github.com>
Co-authored-by: Chang Xu <42978935+changxu0306@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it 🚢
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.