I am running a backend authentication and authorization using Cognito , Api gateway and lambda.
I go this error report and was told to refer back to my cognito settings . But I dont know how to reconfigure it and fix the problem now.
{
“statusCode”: 400,
“body”: “{"error":"CustomMessage failed with error str expected, not tuple."}”
}
This I saw in resolving it.
In your Cognito User Pool, you probably have a CustomMessage Lambda trigger set up (maybe to format SMS/Email verification codes).
That Lambda must return a string, but right now it’s returning a tuple (or array-like) value.
Cognito expects something like:
event.response.smsMessage = “Your verification code is: 123456”;
event.response.emailMessage = “Your verification code is: 123456”;
event.response.emailSubject = “Verify your account”;
return event;