-
-
Notifications
You must be signed in to change notification settings - Fork 373
Closed
Labels
Description
I'm writing a Cognito pre token generation lambda using bref. The docs at https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html suggest that the callback is called with 2 parameters. If I do that in php e.g.
$callback(null, $event);
then I get an error :
{
"errorType": "ArgumentCountError",
"errorMessage": "Too few arguments to function {closure}(), 2 passed in /var/task/vendor/bref/bref/src/Runtime/LambdaRuntime.php on line 109 and exactly 3 expected",
"stack": [
"#0 /var/task/vendor/bref/bref/src/Runtime/LambdaRuntime.php(109): {closure}()",
"#1 /opt/bref/bootstrap.php(38): Bref\\Runtime\\LambdaRuntime->processNextEvent()",
"#2 {main}"
]
}
I also looked at https://aws.amazon.com/blogs/mobile/how-to-use-cognito-pre-token-generators-to-customize-claims-in-id-tokens/ and simply returned the event which leads to the same error being thrown.
Does anyone know what that callback signature should be for PHP as the node/python examples don't translate.
Reactions are currently unavailable