jagregory / cognito-local

Local emulator for Amazon Cognito
MIT License
278 stars 67 forks source link

ValidationData is not passed on to Lambda trigger in PreSignUp #351

Open mhariri opened 1 year ago

mhariri commented 1 year ago

Steps to reproduce:

  1. Send this request (assuming specified clientId is defined)
    curl 'http://localhost:9229/' \
    -H 'Accept: application/json, text/plain, */*' \
    -H 'Accept-Language: en-US,en;q=0.9' \
    -H 'Cache-Control: no-cache' \
    -H 'Connection: keep-alive' \
    -H 'Origin: http://localhost:3000' \
    -H 'Pragma: no-cache' \
    -H 'Referer: http://localhost:3000/' \
    -H 'Sec-Fetch-Dest: empty' \
    -H 'Sec-Fetch-Mode: cors' \
    -H 'Sec-Fetch-Site: same-site' \
    -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' \
    -H 'content-type: application/x-amz-json-1.1' \
    -H 'sec-ch-ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"' \
    -H 'sec-ch-ua-mobile: ?0' \
    -H 'sec-ch-ua-platform: "macOS"' \
    -H 'x-amz-target: AWSCognitoIdentityProviderService.SignUp' \
    --data-raw '{"ClientId":"e3o4s4tigabbf9wjm2fbny7ca","Password":"123123","Username":"a@a.com","UserAttributes":[{"Name":"locale","Value":"en"},{"Name":"custom:confirmationCode","Value":"540742"}],"ValidationData":[{"Name":"isBusiness","Value":"true"},{"Name":"userId","Value":"2739"},{"Name":"inviteUrl"}]}' \
    --compressed

Expected behaviour: Lambda function is called with specified ValidationData

Actual: Lambda function is called with undefined validationData