According to the documentation, the signature for the Post Change Password hook should be:
function (user, context, cb)
However, when I try this, I get the following error:
{
"code": 500,
"error": "Script generated an unhandled synchronous exception.",
"details": "TypeError: cb is not a function",
}
When I tried to add a 4th parameter I got
{
"code": 400,
"message": "Invalid webtask code",
"error": "The JavaScript compiledFunction must have one of the following signatures: ([ctx], callback) or (ctx, req, res)."
}
It seems like I’m able to make it work by using
function (context, cb)
and then retrieving the user from context.body.user
.
Is this correct?
Could you update the documentation please?
Thanks