File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
packages/auth/amplify_auth_cognito_dart/lib/src/state/machines Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -658,18 +658,11 @@ final class SignInStateMachine
658
658
required bool hasUserResponse,
659
659
}) async {
660
660
final allowedMfaTypes = _allowedMfaTypes;
661
- if (allowedMfaTypes == null || allowedMfaTypes.isEmpty) {
662
- throw const InvalidUserPoolConfigurationException (
663
- 'No MFA types are allowed for setup.' ,
664
- recoverySuggestion: 'Check your user pool MFA configuration.' ,
665
- );
666
- }
667
-
668
661
// Exclude MfaType.sms from consideration
669
- final mfaTypesForSetup = allowedMfaTypes.difference ({MfaType .sms});
670
- if (mfaTypesForSetup.isEmpty) {
662
+ final mfaTypesForSetup = allowedMfaTypes? .difference ({MfaType .sms});
663
+ if (allowedMfaTypes == null || allowedMfaTypes.isEmpty || mfaTypesForSetup == null || mfaTypesForSetup.isEmpty) {
671
664
throw const InvalidUserPoolConfigurationException (
672
- 'No eligible MFA types are available for setup.' ,
665
+ 'No eligible MFA types are allowed for setup.' ,
673
666
recoverySuggestion: 'Check your user pool MFA configuration.' ,
674
667
);
675
668
}
You can’t perform that action at this time.
0 commit comments