Saltar al contenido

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!

preguntada hace un año290 visualizaciones
1 Respuesta
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
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.