furaiev / amazon-cognito-identity-dart-2

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
188 stars 114 forks source link

CognitoUserDeviceConfirmationNecessaryException is not being thrown #239

Closed felipeapfer closed 1 year ago

felipeapfer commented 1 year ago

Hello @furaiev ! I`m running on this "issue" mentioned on #192 #165 . When User Opt-in is activated the ConfirmUser exception is thrown and I do believe it is due to the fact that this PR only throws CognitoUserDeviceConfirmationNecessaryException for MFA.

In this scenario I believe it would be correct to throw the CognitoUserDeviceConfirmationNecessaryException too since it is a valid option configuration of Cognito.

As a temporary work around one can check if there is a valid signInUserSession on the Exception object. If so it is an issue with the device registration otherwise it is indeed an error of user needs to confirm account.

furaiev commented 1 year ago

Hello @felipeapfer , thanks for reporting the issue. Could you please prepare a PR with the proposed fixes?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.