How to call sendMFACode function from out of the authenticateUser in aws cognito

48 Views Asked by At

How to call the sendMFACode function from out of the authenticateUser function in the AWS cognito for node js rest API.

When I executing the cognitoUser.sendMFACode. I get the following error:

{ code: 'InvalidParameterException',
  name: 'InvalidParameterException',
  message: 'Missing required parameter Session' }

The executed code is

cognitoUser.sendMFACode('123456', {
                onSuccess: function (result) {
                   console.log(result);
                },
                onFailure: function (err) {
                   console.log(err);
                }
            })

cognitoUser.getSession() works only for authenticated user

Error: Missing required parameter Session

0

There are 0 best solutions below