Salta al contenuto

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!

posta un anno fa289 visualizzazioni
1 Risposta
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
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.