Link to home
Start Free TrialLog in
Avatar of mehmet ugur
mehmet ugur

asked on

How to solve "CustomMessage failed with error Cannot read property identity of undefined" error in AWS?

i use aws-sdk for javascript to give user choice to enable/disable 2 factor auth for login. i have 2 issues: UI is capturing user phone and updates cognito phone_number attribute. (updateUserAttributes) First issue is with this stage, it updates the number but returns empty object instead of

{
    "CodeDeliveryDetailsList": [ 
    { 
        "AttributeName": "string",
        "DeliveryMedium": "string",
        "Destination": "string"
    }
    ]
}

Open in new window

Second, i am trying to send user a verification code with getAttributeVerificationCode with the following payload:

const params = { 
  AccessToken: auth.accessToken,    
  AttributeName: 'phone_number'
}

Open in new window

and i am getting "CustomMessage failed with error Cannot read property identity of undefined" error. Any ideas?

Thanks
Avatar of Kyle Santos
Kyle Santos
Flag of United States of America image

Hi,

I am here to help you with your open question.  Do you still need help?  I have the ability to alert more experts if you still need help.

If you solved the problem on your own, would you please post the solution here in case others have the same problem?

If you need me to delete this question just say "Delete."

Thank you for using Experts Exchange.

Regards,

Kyle Santos
Customer Relations
Avatar of mehmet ugur
mehmet ugur

ASKER

Hi Kyle, my problem still continues, if you could please help it will be appreciated. Thanks
ASKER CERTIFIED SOLUTION
Avatar of mehmet ugur
mehmet ugur

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for letting us know!