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

[Authenticator] Allow specifying string messages for arbitrary exception types #181

Open
1 task done
mattcreaser opened this issue Aug 21, 2024 · 1 comment
Open
1 task done
Assignees
Labels
authenticator This issue relates to the Authenticator component feature-request New feature or request

Comments

@mattcreaser
Copy link
Member

Before opening, please confirm:

Which UI component is this feature-request for?

Authenticator

Please include any relevant guides or documentation you're referencing

No response

Please describe your feature-request in detail.

On the Swift Authenticator, you can specify string content for any cognito error by using a specific string key, even if Authenticator itself doesn't have any logic for that case. We should implement a similar system on Android.

  1. When resolving the string content for an error scenario, first check to see if application has defined a specific string for that exception.
  2. If not, use the default string specified in Authenticator.

The list of exceptions we can expect to receive can be found here. We can transform the exception type into a string resource ID using some known algorithm, something like:

  1. Strip the "Exception" suffix
  2. Transform the remaining name to snake_case
  3. Prepend amplify_ui_authenticator_error_

This would result in e.g. ParseTokenException resolving to a string R.string.amplify_ui_authenticator_error_parse_token that could be defined in the application resources to set the content for this exception.

Initialization steps (if applicable)

No response

Code Snippet

// Put your code below this line.

amplifyconfiguration.json

No response

Additional information and screenshots

No response

Copy link
Contributor

This issue was opened by a maintainer of this repository; updates will be posted here. If you are also experiencing this issue, please comment here with any relevant information so that we're aware and can prioritize accordingly.

@github-actions github-actions bot added the pending-triage Issue is pending triage label Aug 21, 2024
@mattcreaser mattcreaser added feature-request New feature or request authenticator This issue relates to the Authenticator component labels Aug 21, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label Aug 21, 2024
@mattcreaser mattcreaser self-assigned this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authenticator This issue relates to the Authenticator component feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant