awsdocs / amazon-cognito-developer-guide

Other
14 stars 47 forks source link

Update Node.js instructions #11

Closed AmaruEscalante closed 1 year ago

AmaruEscalante commented 3 years ago

Using callback leads to errors, since the object it's empty. I tested it and logged the output, using return solves the problem.

2021-08-23T06:26:33.527Z b61d41b7-a66e-476f-950c-680f5407d8e5 ERROR Invoke Error { "errorType": "TypeError", "errorMessage": "callback is not a function", "stack": [ "TypeError: callback is not a function", " at Object.exports.handler (/var/task/custom.js:7:3)", " at /var/task/index.js:37:50", " at Array.map ()", " at Runtime.exports.handler (/var/task/index.js:37:29)", " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" ] }

Description of changes: Changed the callback(null, event); line of the documentation to return event; about the PreSignUp Trigger since using callback doesn't work because the object it's empty and the function doesn't return.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

AMZ-brandon commented 2 years ago

Thank you for your request. I will confirm your fix to the code sample and merge/update after. I will provide updates here about progress.

joshbean commented 1 year ago

Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the 'awsdocs' org), see the announcement on the AWS News Blog.