跳至內容

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!

已提問 1 年前檢視次數 290 次
1 個回答
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
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。