# Post Change Password hook signature

**URL:** <https://community.auth0.com/t/post-change-password-hook-signature/40166>\
**Category:** Get Help\
**Tags:** change-password, hooks\
**Created:** [March 30, 2020, 10:17am UTC](https://community.auth0.com/t/post-change-password-hook-signature/40166 "2020-03-30T10:17:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pureza](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pureza/32/19307_2.png) [@pureza](https://community.auth0.com/u/pureza)\
**Post date:** [March 30, 2020, 10:17am UTC](https://community.auth0.com/t/post-change-password-hook-signature/40166/1 "2020-03-30T10:17:57Z")

</div>

According to the [documentation](https://auth0.com/docs/hooks/extensibility-points/post-change-password), 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

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2020, 2:48pm UTC](https://community.auth0.com/t/post-change-password-hook-signature/40166/2 "2020-03-31T14:48:06Z")

</div>

Hey there!

Let me pass it to the team responsible for the hooks functionality. I’ll get back to you soon!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2020, 3:41pm UTC](https://community.auth0.com/t/post-change-password-hook-signature/40166/3 "2020-03-31T15:41:20Z")

</div>

I managed to get the info back. This is a known issue and captured in an existing ticket. We have a fix for this issue that will be released in the next few days.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2020, 3:52pm UTC](https://community.auth0.com/t/post-change-password-hook-signature/40166/4 "2020-03-31T15:52:37Z")

</div>

As a workaround, if you delete this extension and recreate it in the manage dashboard with the hooks code editor UI, the hook should work as expected.

The “callback is not a function” error only happens with hooks created via the Management API, but hooks created in the UI do not have this issue.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 15, 2020, 3:52pm UTC](https://community.auth0.com/t/post-change-password-hook-signature/40166/5 "2020-04-15T15:52:37Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
