# Auth0 password change with actions

**URL:** <https://community.auth0.com/t/auth0-password-change-with-actions/119868>\
**Category:** Get Help\
**Tags:** reset-password-prompt-new-experience, login-experience\
**Created:** [October 31, 2023, 2:29pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868 "2023-10-31T14:29:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![adminiot](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@adminiot](https://community.auth0.com/u/adminiot)\
**Post date:** [October 31, 2023, 2:29pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/1 "2023-10-31T14:29:42Z")

</div>

Hello,

I found a solution for the problem, but it is for hooks ([Sending password change email instead of verification email for a new user - #3 by stephanie.chamblee](https://community.auth0.com/t/sending-password-change-email-instead-of-verification-email-for-a-new-user/55713/3)).  
Is there one for actions?

I adjusted the hook code to the actions version but get the following error messag:

###### Test Results

###### Error:

```auto
{
  "message": "authClient.requestChangePasswordEmail is not a function",
  "name": "TypeError",
  "stack": "TypeError: authClient.requestChangePasswordEmail is not a function\n at exports.onExecutePostUserRegistration (/data/io/node18-actions/eb0226ed-9d75-4aab-938f-39324a6ea7de/webtask.js:20:14)\n at /data/io/0c8366ec199636bd5aa9715551a2d91fb6316755.js:7:907\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
}

```

Kind regards,

David Bos

---

<div class="post-metadata">

**Author:** ![simon.paris](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/simon.paris/32/33897_2.png) [@simon.paris](https://community.auth0.com/u/simon.paris)\
**Post date:** [November 10, 2023, 7:28pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/3 "2023-11-10T19:28:28Z")

</div>

I am experiencing the same issue with what should be very basic code. What are we missing???

```auto
exports.onExecutePostLogin = async (event) => {
if (event.user.email !== undefined) {
    const auth0 = require('auth0');
    const authClient = new auth0.AuthenticationClient({
      domain: event.secrets.domain,
      clientId: event.secrets.clientId
    });

  const userAndConnection = {
      email: event.user.email,
      connection: 'Username-Password-Authentication'
    };

  // Send password change email
    await authClient.requestChangePasswordEmail(userAndConnection, (err) => {
      
      })
  }
};
      

```

---

<div class="post-metadata">

**Author:** ![annabell](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/annabell/32/49753_2.png) [@annabell](https://community.auth0.com/u/annabell)\
**Post date:** [December 3, 2023, 4:49pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/4 "2023-12-03T16:49:15Z")

</div>

Hello there,

I am facing the exact same issue and did not find a solution to this so far. @simon.paris or @adminiot were you able to figure this out?

Any help would be highly appreciated!

---

<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:** [January 8, 2024, 12:51pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/5 "2024-01-08T12:51:33Z")

</div>

Hey there!

As this topic is related to Actions and Rules & Hooks are being deprecated soon in favor of Actions, I’m excited to let you know about our next [Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team](https://community.auth0.com/t/auth0-community-ask-me-anything-rules-hooks-and-why-actions-matter/124043) on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

[Learn more here!](https://community.auth0.com/t/auth0-community-ask-me-anything-rules-hooks-and-why-actions-matter/124043)

---

<div class="post-metadata">

**Author:** ![jason16](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jason16](https://community.auth0.com/u/jason16)\
**Post date:** [January 12, 2024, 12:35pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/6 "2024-01-12T12:35:06Z")

</div>

@konrad.sopala - not helpful. This response is getting pushed into every Actions-related thread, but doing nothing to answer any of the questions posted in your community. This is quickly diluting the usefulness of these forums.

---

<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:** [January 12, 2024, 1:06pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/7 "2024-01-12T13:06:43Z")

</div>

As communicated, in the community thread above, once you post there your question **it will be answered on January 18th**. Thank you!

---

<div class="post-metadata">

**Author:** ![adminiot](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@adminiot](https://community.auth0.com/u/adminiot)\
**Post date:** [January 16, 2024, 7:19am UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/8 "2024-01-16T07:19:06Z")

</div>

We solved it like this:

````auto
exports.onExecutePostUserRegistration = async(event, api) => {

    var axios = require("axios").default;

    var options = {
        method: 'POST',
        url: 'https://' + event.secrets.DOMAIN + '/dbconnections/change_password',
        headers: {
            'content-type': 'application/json'
        },
        data: {
            client_id: event.secrets.CLIENT_ID,
            email: event.user.email,
            connection: 'Username-Password-Authentication'
        }
    };

    axios.request(options).then(function (response) {
        console.log(response.data);
    }).catch(function (error) {
        console.error(error);
    });
};```

And disabled the verification email.
````

---

<div class="post-metadata">

**Author:** ![kalana.jayasuriya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kalana.jayasuriya/32/33596_2.png) [@kalana.jayasuriya](https://community.auth0.com/u/kalana.jayasuriya)\
**Post date:** [February 2, 2024, 12:39pm UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/9 "2024-02-02T12:39:16Z")

</div>

@adminiot If you don’t mind I will attach Stackoverflow Thread as well here. Full answer can approach via this link → [node.js - How to send password change email instead of verification email for a new user in Auth0 in 2024 - Stack Overflow](https://stackoverflow.com/questions/77906252/how-to-send-password-change-email-instead-of-verification-email-for-a-new-user-i/77922102?noredirect=1#comment137380171_77922102)

---

<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:** [August 13, 2025, 12:43am UTC](https://community.auth0.com/t/auth0-password-change-with-actions/119868/10 "2025-08-13T00:43:10Z")

</div>

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