amplify-flutter icon indicating copy to clipboard operation
amplify-flutter copied to clipboard

Feature Request: Export UnmetPasswordRequirements

Open JoseAlba opened this issue 1 year ago • 6 comments

Description

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.

Categories

  • [ ] Analytics
  • [ ] API (REST)
  • [ ] API (GraphQL)
  • [ ] Auth
  • [X] Authenticator
  • [ ] DataStore
  • [ ] Notifications (Push)
  • [ ] Storage

Steps to Reproduce

Try to override UnmetPasswordRequirements in passwordRequires method

Screenshots

No response

Platforms

  • [X] iOS
  • [X] Android
  • [X] Web
  • [X] macOS
  • [X] Windows
  • [X] Linux

Flutter Version

3.24.1

Amplify Flutter Version

2.4.1

Deployment Method

Amplify Gen 2

Schema

No response

JoseAlba avatar Sep 10 '24 12:09 JoseAlba

This PR fixe this issue: https://github.com/aws-amplify/amplify-flutter/pull/5403

JoseAlba avatar Sep 10 '24 12:09 JoseAlba

Hi @JoseAlba, thanks for taking the time to open this issue and PR.

Please address the feedback on the PR and we will get this merged

Equartey avatar Sep 10 '24 18:09 Equartey

Thank you Elijah, I addressed your comment

JoseAlba avatar Sep 10 '24 19:09 JoseAlba

Hi @JoseAlba, I created PR #5437 to address some additional linter errors. This will also simply the CI permission process that was causing checks to fail on your PR. I will let you know once it get's merged!

tyllark avatar Sep 11 '24 20:09 tyllark

LGTM

JoseAlba avatar Sep 12 '24 18:09 JoseAlba

@JoseAlba We just merged the PR, so the changes will be available with our next release. We will post an update here when we deploy the release!

tyllark avatar Sep 16 '24 23:09 tyllark

Sorry we lost track of this issue. Closing as the fix was released half a year ago!

tyllark avatar Apr 15 '25 16:04 tyllark

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Apr 15 '25 16:04 github-actions[bot]