amazon-archives / amazon-cognito-identity-js

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

TypeError with AdminConfirmSignUp #686

Closed TG-EBSCO closed 6 years ago

TG-EBSCO commented 6 years ago

When trying to call makeUnauthenticatedRequest i get the following error

code:"TypeError"
message:"Cannot read property 'input' of undefined"
name:"TypeError"
stack:"TypeError: Cannot read property 'input' of undefined\n    at Request.VALIDATE_PARAMETERS (\node_modules\aws-sdk\lib\event_listeners.js:123:61)\n    at Request.callListeners (\node_modules\aws-sdk\lib\sequential_executor.js:105:20)\n    at Request.emit (node_modules\aws-sdk\lib\sequential_executor.js:77:10)\n    at Request.emit (node_modules\aws-sdk\lib\request.js:683:14)\n    at Request.transition (\node_modules\aws-sdk\lib\request.js:22:10)\n    at AcceptorStateMachine.runTo (\node_modules\aws-sdk\lib\state_machine.js:14:12)\n    at Request.runTo (node_modules\aws-sdk\lib\request.js:403:15)\n    at Request.send (node_modules\aws-sdk\lib\request.js:367:10)\n    at features.constructor.makeUnauthenticatedReq...

My code snippet is

userPool.client.makeUnauthenticatedRequest('AdminConfirmSignUp', {
        UserPoolId: poolData.UserPoolId,
        Username: usr
      }, err => {
        if (err) {
          console.log(err)
          return
        }
        console.log('user confirmed')
      });
     },

Any ideas on what I might be doing wrong?

itrestian commented 6 years ago

You should call the operation on the client directly. That's not part of this library, it is part of the main aws sdk located here: https://github.com/aws/aws-sdk-js

It is also an authenticated operation so you are required to provide AWS credentials when calling it.

TG-EBSCO commented 6 years ago

Thank you for the quick response !! Using the aws-sdk directly to create users and signup as admin worked!!Will the above operation be added to the cognito identity library anytime soon?