# Password change problem 404 error

**URL:** <https://community.auth0.com/t/password-change-problem-404-error/110884>\
**Category:** Get Help\
**Tags:** reset-password-prompt-new-experience, login-experience\
**Created:** [July 10, 2023, 1:37pm UTC](https://community.auth0.com/t/password-change-problem-404-error/110884 "2023-07-10T13:37:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugo127sanchez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hugo127sanchez/32/47506_2.png) [@hugo127sanchez](https://community.auth0.com/u/hugo127sanchez)\
**Post date:** [July 10, 2023, 1:37pm UTC](https://community.auth0.com/t/password-change-problem-404-error/110884/1 "2023-07-10T13:37:04Z")

</div>

good morning my problem is the following this is my code

```auto
 const changePassword = () => {
    const url =
      "https://dev-elbuensabor.us.auth0.com/dbconnections/change_password";
    const clientId = "";
  
    const data = {
      client_id: clientId,
      email: "",
      connection: "Username-Password-Authentication",
    };
    fetch(url, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(data),
    })
      .then((response) => response.json())
      .then((data) => {
        console.log(data);
      })
      .catch((error) => {
        console.error(error);
      });
  };

```

When I go I want to give my password change button. It gives me a 404 error.  
or  
act\_devtools\_backend\_compact.js:2367 SyntaxError: Unexpected token ‘W’, “We’ve just”… is not valid JSON

---

<div class="post-metadata">

**Author:** ![gparascandolo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gparascandolo/32/38788_2.png) [@gparascandolo](https://community.auth0.com/u/gparascandolo)\
**Post date:** [July 10, 2023, 7:47pm UTC](https://community.auth0.com/t/password-change-problem-404-error/110884/2 "2023-07-10T19:47:27Z")

</div>

Hey @hugo127sanchez, the Authentication API [/dbconnections/change\_password](https://auth0.com/docs/api/authentication?http#change-password) endpoint does not return a JSON response - you should be able to fix your function by changing `response.json()` to `response.text()`.

The response you should see in your console.log afterwards is: `We've just sent you an email to reset your password.`

Hope this helps!

---

<div class="post-metadata">

**Author:** ![hugo127sanchez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hugo127sanchez/32/47506_2.png) [@hugo127sanchez](https://community.auth0.com/u/hugo127sanchez)\
**Post date:** [July 11, 2023, 1:12am UTC](https://community.auth0.com/t/password-change-problem-404-error/110884/3 "2023-07-11T01:12:00Z")

</div>

Thank you very much for the reply. I made the change and it worked!

---

<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:** [July 11, 2023, 9:47am UTC](https://community.auth0.com/t/password-change-problem-404-error/110884/4 "2023-07-11T09:47:47Z")

</div>

Teamwork makes the dreamwork!

---

<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:** [July 25, 2023, 9:48am UTC](https://community.auth0.com/t/password-change-problem-404-error/110884/5 "2023-07-25T09:48:34Z")

</div>

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