I'm trying to implement sign up using AWS amplify. Here is the code,
import { Auth } from 'aws-amplify';
async function signUp() {
try {
const { user } = await Auth.signUp({
username,
password,
attributes: {
email,
phone_number
}
});
console.log(user);
} catch (error) {
console.log('error signing up:', error);
}
}
But I'm getting the following 400 error,
InvalidLambdaResponseException : Invalid lambda function output : Invalid JSON
This usually happens when there's a Sign-Up lambda trigger defined which is failing for some reason such as:
You should check the lambda triggers in the userpool and check their cloudwatch logs for more information.
If the User is not created at all, most likely it's on the Pre sign-up Lambda trigger.