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
182 stars 113 forks source link

how to solve custom challenge? #241

Closed mhernandezsuk closed 10 months ago

mhernandezsuk commented 11 months ago

My users' login requires the resolution of a CUSTOM_CHALLENGE and what happens is that initiateAuth() returns an exception, which says precisely that the user requires a CUSTOM_CHALLENGE to advance.

After this first step, the user completes the challenge data that arrives via email and enters a 6-digit code.

Now at this point when sending this challenge sendCustomChallengeAnswer() returns the following: CognitoClientException{statusCode: 400, code: InvalidParameterException, name: InvalidParameterException, message: Missing required parameter Session}

Session is not a parameter of the sendCustomChallengeAnswer() function and Session does not exist either since initAuth() returns an exception.

What alternative is there to this? Is it an implementation problem?

thank you !

furaiev commented 11 months ago

The session is included to request: https://github.com/furaiev/amazon-cognito-identity-dart-2/blob/main/lib/src/cognito_user.dart#L811

Probably it is missed in your specific case

github-actions[bot] commented 10 months ago

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

github-actions[bot] commented 10 months ago

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