Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
Which is the correct format for Lambda AWS PreSignUp Response

I'm working on a VUE+Amplify project, it's almost done, but cognito does not offer mail duplication check, so i've to do it manually, as we know AWS has some triggers i'm using PreSignUp invoking a Lambda function, my code is:

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);
    }
  });
}

but I dont understand what I am doing wrong, the lambda execution returns...

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

Any idea?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to return the event object

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

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda