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): enables custom auth flows #1444

Merged
merged 32 commits into from
May 11, 2022

Conversation

haverchuck
Copy link
Contributor

@haverchuck haverchuck commented Mar 8, 2022

Issue #, if available:
#410

Description of changes:
Enables custom authentication flows.

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

@haverchuck haverchuck force-pushed the feat/custom-auth/no-validation branch 2 times, most recently from 0b23781 to bfdc7c2 Compare March 21, 2022 21:22
@haverchuck haverchuck marked this pull request as ready for review March 22, 2022 17:37
@haverchuck haverchuck requested a review from a team as a code owner March 22, 2022 17:37
@haverchuck haverchuck force-pushed the feat/custom-auth/no-validation branch from 12caeab to ea5367f Compare May 8, 2022 04:14
@@ -126,7 +126,7 @@ class AuthenticatorInputLocalizationsEn
}

@override
String passwordRequirementsAtLeast(int numCharacters, String characterType) {
String passwordRequirementsAtLeast(num numCharacters, String characterType) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this not always an int? I assume if it is not an int it is still a whole number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was changed on one of my initial commits, and I cannot recall why. I'm changing it back. If there is an issue with it, it's immaterial to this PR.

@@ -75,3 +75,11 @@ class VerifyUserFlow extends UnauthenticatedState {
const VerifyUserFlow({required this.unverifiedAttributeKeys})
: super(step: AuthenticatorStep.verifyUser);
}

class ConfirmSignInCustom extends UnauthenticatedState {
final Map<dynamic, dynamic> publicParameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

Still shows dynamic, dynamic for me

@@ -44,6 +44,14 @@ class AuthenticatorState extends ChangeNotifier {
_resetAttributes();
}
});

// Always listen for ConfirmSignInCustom events (not distinct)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't make a difference. distinct just means that two identical events will not be emitted back-to-back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - I thought that this might be needed for multiple Custom Challenges.

/// Uses [ButtonResolverKey.confirm] for localization
/// {@endtemplate}
class ConfirmSignInCustomButton extends ConfirmSignInMFAButton {
/// {@macro amplify_authenticator.confirm_sign_custom_button}
Copy link
Contributor

Choose a reason for hiding this comment

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

Template string does not match above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@haverchuck haverchuck merged commit 2256175 into aws-amplify:main May 11, 2022
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