-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add custom translatable error messages from Cognito #949
Conversation
🦋 Changeset detectedLatest commit: 1520b6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
And( | ||
'the {string} input is in {string} and I type the wrong username or password', | ||
(label: string, language: string) => { | ||
cy.findByPlaceholderText(translations[language][label].trim()).type( | ||
'UNKNOWN@UNKNOWN.com' | ||
); | ||
} | ||
); | ||
|
||
And( | ||
'the {string} button is in {string} and I click it', | ||
(label: string, language: string) => { | ||
cy.findByRole('button', { | ||
name: translations[language][label].trim(), | ||
}).click(); | ||
} | ||
); | ||
|
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.
New helpers for translations
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.
LGTM
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.
🚢
Why is there no support for react-native? Is there a list of possible errors (errors thrown by aws cognito provider, not the js Authenticator) What if for some reason the aws amplify error changes from 'User does not exist.' to something else? Isn't there a more robust approach? |
Issue #, if available:
#255
Description of changes:
This fix will allow users to overwrite any error or validation error message in the application. For example a user can overwrite the error message when a user does not exist when logging in.
You can see an example of this in our
i18n
feature test.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.