amazon-archives / amazon-cognito-identity-js

Amazon Cognito Identity SDK for JavaScript
Other
984 stars 454 forks source link

How to use sign in with phone confirmation? #655

Closed kirkins closed 6 years ago

kirkins commented 6 years ago

I'm trying to implement use case 4 "Authenticating a user and establishing a user session with the Amazon Cognito Identity service". Except my cognito pool requires verifying with text message for login.

After the login I get a text message as expected.

In the front-end javascript I get back:

Uncaught Error: callback.mfaRequired is not a function

How do I implement this, to test I just want to run a javascript prompt() and send the code in the callback.

itrestian commented 6 years ago

You would have to implement the particular mfaRequried callback. Check use case 27 for example for implementing mfaRequired.