Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
¿Cuál es el formato correcto para Lambda AWS PreSignUp Response?

Estoy trabajando en un proyecto VUE+Amplify, está casi terminado, pero cognito no ofrece verificación de duplicación de correo, así que tengo que hacerlo manualmente, como sabemos que AWS tiene algunos disparadores, estoy usando PreSignUp invocando una función Lambda, mi código es:

 var AWS = require("aws-sdk"); const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); exports.handler = function(event, context, callback) { var params = { UserPoolId: "us-east-1_xxxXXXxXX", AttributesToGet: ["email"] }; cognitoidentityserviceprovider.listUsers(params, (err, data) => { if (err) { console.log(err, err.stack); callback(err) // here is the error return } else { data.Users.forEach(function(usuario) { if(usuario.Attributes[0].Value == event.request.userAttributes.email){ return {}; } }); callback(event); } }); }

pero no entiendo que estoy haciendo mal, vuelve la ejecucion lambda...

 Object { code: "UserLambdaValidationException", name: "UserLambdaValidationException", message: "PreSignUp failed with error [object Object]." }

¿Alguna idea?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Necesitas devolver el objeto del evento.

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!