Hi
I followed the Node.js example explained here and I alway get the following exception on Cognito login.
{"__type":"InvalidLambdaResponseException","message":"Unrecognizable lambda output"}
The only time it works is, if I call callback immediately without altering the event response
exports.handler = (event, context, callback) => {
callback(null, event);
};
This example here (copy pasted from the guide) does not work and throws the mentioned exception "Unrecognizable lambda output". Even if I simplify it to this, it throws the same exception:
exports.handler = (event, context, callback) => {
event.response = {
"claimsOverrideDetails": {
"claimsToAddOrOverride": {
"attribute_key2": "attribute_value2",
"attribute_key": "attribute_value"
},
}
};
// Return to Amazon Cognito
callback(null, event);
};
I also tried to stringily the event, not calling the callback but instead return the event, etc. Always the same result.
An idea anyone?
This probably doesn't help, but I had the same issue until I added a 'return event;' after the callback. The weird thing is that it now still works even when I take out the return line.
Thanks @rePost-User-7943174 I have tried your approach but I still got the same error.
After calling
callback(null, event)
I added the statementreturn event
but it lead to the same error