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

feat/auth-export-unmet-password-requirements export #5403

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JoseAlba
Copy link
Contributor

Need to export UnmetPasswordRequirements as developers can not currently override class: InputResolver method: passwordRequires.

Amplify_authenticator is exporting auth_strings_resolver and auth_strings_resolver exports input_resolver. Input resolver has a few methods that are meant to be exposed to the public to be overriden.

file:amplify_authenticator.dart
export 'src/l10n/auth_strings_resolver.dart' hide ButtonResolverKeyType;

file: auth_string_resolver.dart
export 'input_resolver.dart';

In method passwordRequires one of the parameters is of type UnmetPasswordRequirements. Previously the API was called PasswordProtectionSettings which was exported for developer usage.

  String passwordRequires(
    BuildContext context,
    UnmetPasswordRequirements requirements,
  ) 

The solution here is exporting the UnmetPasswordRequirements so that developers can override the InputResolver class. If Amplify doesn't want to continue extending this API, I recommend using the dart keyword sealed so that the class can't be extended.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@JoseAlba JoseAlba requested a review from a team as a code owner August 31, 2024 13:15
Copy link
Contributor

@Equartey Equartey left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I left one small request.

@JoseAlba JoseAlba requested a review from Equartey September 10, 2024 23:33
@JoseAlba
Copy link
Contributor Author

Test seems to be failing because of a separate issue. Nothing to be done from this PR likely

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

Successfully merging this pull request may close these issues.

3 participants