Skip to content

How can I modify the response of a PreSignup Trigger?

1

Hello, I am currently using the Cognito PreSignUp trigger to validate and insert the user attributes both default and custom into the database. I need a way to return the the userId (which is generated by the database incrementally) in the response of the trigger so the frontend can have the userId for future api calls. I am open to any other suggestions of doing this?

  • I too would like to know this as I am struggling sending my users from Cognito into my User Table of DynamoDB, so I assume I will struggle with AppSync API and Users too. Thanks for asking this question!

asked a year ago282 views
1 Answer
0

You can add the userId as a custom attribute to the event.response.userAttributes object. This will ensure the userId is included in the response from the trigger.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.